Solved

How to extract string from a file in inno setup

Posted on 2008-06-24
2
2,338 Views
Last Modified: 2013-11-14
Hi All,

I'm creating a installation setup which is contains ports specifications. i.e in which port the application need to be run. In that i want to check the given port is available to use. Hence i wrote a *.bat file using innosetup which contains the command 'netstat -o > output.txt'. Im able to create the *.bat & output.txt files successfully. Now the problem is i dont know how to read that file line by line and check the given port is listeing state or in some status.

Can any one tell me how to find the string in file with innosetup? urgent..

Thanks in advance,...

Regards,
Prince
0
Comment
Question by:ilava
2 Comments
 
LVL 18

Accepted Solution

by:
mirtheil earned 150 total points
ID: 21858367
You might want to take a look at the LoadStringsFromFile command.  It'll read the file into a string array that you can manipulate.  
Then again, randomly picking ports may not be the best idea.  What happens if you have another program on that machine that's currently disabled but uses the same port?  You should pick a known port that's not used.  The list of ports and what uses them is at http://www.iana.org/assignments/port-numbers.  My suggestion would be to use a default port and on application start up check the port.  If it's not available, offer the user a different choice.  
0
 
LVL 3

Author Closing Comment

by:ilava
ID: 31470133
Thanks buddy...
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Among others, I monitor the Windows Installer zone and Installer zone. I find that many of the questions could be answered much more quickly if a Windows Installer verbose log were submitted with the question.   However, I do not always have t…
Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now