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
- :
- InstallShield
- :
- InstallShield Forum
- :
- Text File Changes using Environment Variable
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
‎Oct 11, 2011
04:28 AM
Text File Changes using Environment Variable
Hi
I am currently using InstallShield 2011 and I am trying to make a Text File Change to an installed file using an Envirnonment Variable.
This is what I have in my criteria:
Find What:
Replace With:
But this does not work as I am not sure of the actual syntax to use when replacing the IP address with the name of the computer using the Environment Variable %COMPUTERNAME%.
Many thanks
Ian
I am currently using InstallShield 2011 and I am trying to make a Text File Change to an installed file using an Envirnonment Variable.
This is what I have in my criteria:
Find What:
Replace With:
But this does not work as I am not sure of the actual syntax to use when replacing the IP address with the name of the computer using the Environment Variable %COMPUTERNAME%.
Many thanks
Ian
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 11, 2011
10:41 AM
Hi There,
I posted briefly on this on the blog:
http://blogs.flexerasoftware.com/installtalk/2011/02/i-didnt-know-installshield-could-do-that.html
Basically, what this means to you is to try changing it to:
I posted briefly on this on the blog:
http://blogs.flexerasoftware.com/installtalk/2011/02/i-didnt-know-installshield-could-do-that.html
Use Property References All Over the Place
If you find yourself saying, "Boy, I wish X feature could use a Property reference", there's a sort of process you can go through to figure out if this is a possibility:
1. Check to see where the Table data is stored. Basically, type a descriptive string into the UI you are using to configure whatever data, and search for it in InstallShield's Direct Editor.
2. Once you've found the table record that holds your data entered in step 1, press 'F1' to bring up the Table Reference.
3. If the field has a data type of 'Formatted', then it can use a Property Reference. There are some other field types that also support this formatting:
Template
Path
RegPath
AnyPath
FormattedSDDLText
Shortcut
InstallShield-Specific tables (Generally named like ISxxx...) is a separate topic, however. Since these tables are used internally are not intended to be manipulated directly, there's no table reference for them.
However, while not advertised in all parts of the Product, generally the InstallShield Developers will use the Windows Installer API "MsiFormatRecord" when processing a data table in an *.msi package:
MsiFormatRecord Function
http://msdn.microsoft.com/en-us/library/aa370109(VS.85).aspx
If a data table contains a string value of some sort that's not obviously used as a Primary key, there's a decent chance it will be formatted by the associated InstallShield Custom Action at runtime before the data is used. My recommendation is to try a property reference if you're not certain, and see if this works for you.
Basically, what this means to you is to try changing it to:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 12, 2011
09:50 AM
Hi Cary
Thank you for your reply. That worked a treat. I also found, from reading your blog, that the environment variable 'ComputerName' is set by the Installer at run time. As well as your suggestion, I also tried the following, with success, in order to place the environment variable into a string (required for a text change within an xml file):
Many thanks for your help.
Ian
Thank you for your reply. That worked a treat. I also found, from reading your blog, that the environment variable 'ComputerName' is set by the Installer at run time. As well as your suggestion, I also tried the following, with success, in order to place the environment variable into a string (required for a text change within an xml file):
Many thanks for your help.
Ian