bbarton11
Level 5

Conditional Text File Update?

Hi All,

Is there a way to do a conditional update of a text file? For example, I have a text file that has a line in it that is "C:\Program Files (x86)\...". Can I do something where if the OS is 32-bit to modify that line to be "C:\Program Files\..." instead?

Thanks as always,
Brian
Labels (1)
0 Kudos
4 Replies
weakness
Level 6

Hello.

Why don't you use [Text File Changes View]?

Text File Changes View
http://kb.flexerasoftware.com/doc/Helpnet/installshield19helplib/helplibrary/TextFileChangesView.htm


Specifying Search-and-Replace Criteria for a Text File Change
http://kb.flexerasoftware.com/doc/Helpnet/installshield19helplib/helplibrary/TextFileChanges-SrchRpl...

And I guess you can use Windows Installer Property INSTALLDIR as [INSTALLDIR].

If you write [INSTALLDIR], then that string will be replaced to actual install folder.
0 Kudos
bbarton11
Level 5

weakness wrote:
Hello.

Why don't you use [Text File Changes View]?

Text File Changes View
http://kb.flexerasoftware.com/doc/Helpnet/installshield19helplib/helplibrary/TextFileChangesView.htm

Thanks, weakness! I see the text file changes but how can I make it change only if a certain condition is met. For example, I have a batch file that has C:\Program Files (x86)\... in it. I'd like to have the installer change it to C:\Program Files\... before I have a custom script launch. Otherwise I'll get an error.
0 Kudos
rrinblue22
Level 9

I think the text file changes are associated to a component.
you can condition the component and then in turn takes care of the text file changes
0 Kudos
munsingh
Level 6

rrinblue22 wrote:
I think the text file changes are associated to a component.
you can condition the component and then in turn takes care of the text file changes


I concur, this is the best way to make conditional changes to text/XML/ini files.
0 Kudos