This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallAnywhere
- :
- InstallAnywhere Forum
- :
- Action Conditional on Text File Search Results
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 13, 2009
11:58 AM
Action Conditional on Text File Search Results
I'd like to make an action execute or not depending on whether a specific line is present in an already-present text file, but I'm not sure even where to begin.
Here are the details:
Prior to installation, I check for the presence of an INI file in a specific location. If it is missing, the installer exits.
At install time, I'd like to check if there are 4 specific lines in the INI file. If the lines are there, then move on. If not, add the 4 lines. Adding the lines is not the problem; checking to see whether they already exist is the problem. Any ideas?
Here are the details:
Prior to installation, I check for the presence of an INI file in a specific location. If it is missing, the installer exits.
At install time, I'd like to check if there are 4 specific lines in the INI file. If the lines are there, then move on. If not, add the 4 lines. Adding the lines is not the problem; checking to see whether they already exist is the problem. Any ideas?
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Nov 13, 2009
12:51 PM
For the existence of the file you've got a built-in condition...
For the line existence you might want to turn to local resources: for instance under Windows you've got the built-in FINDSTR command and on Unices the good ol' grep...
For the line existence you might want to turn to local resources: for instance under Windows you've got the built-in FINDSTR command and on Unices the good ol' grep...
![](/skins/images/A5EADE085F77DE82FB3B14D6B307AE6A/responsive_peak/images/icon_anonymous_message.png)