Solved

How to extract string from a file in inno setup

Posted on 2008-06-24
2
2,421 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

717 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