• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2507
  • Last Modified:

How to extract string from a file in inno setup

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
ilava
Asked:
ilava
1 Solution
 
mirtheilCommented:
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
 
ilavaAuthor Commented:
Thanks buddy...
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now