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
- :
- Re: Dynamically setting environment variables via properties
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 30, 2009
10:39 AM
Dynamically setting environment variables via properties
I wonder if you can help me...
I need to append a value to to the path environment variable - this is the path to some software that may (or may not) be previously installed. So I go to the registry and find out the app path for this piece of software, no problem.
I have then set up a property through the property manager, called ITPath, to hold this information and update it when the install is run. Using MsiSetProperty in my script this gets updated correctly. So far, so good...
Using the environment variables design view I set the value property of my path entry to [ITPath] - in the hope that this will be the value that I've set earlier in the script.
This, unfortunately, doesn't work.
It appears that this value property is set when the installer is built, not when it is run - I can put any old rubbish manually into the ITPath property at design time and this is then set as the environment variable, even though the property itself is being successfully updated when the install is run.
Is there anyway to get the value for an environment variable to update dynamically at install time?
I've also tried manually setting the path environment variable by writing directly to the registry in script, but when you then uninstall the program InstallShield then rather unhelpfully removes this entry, deleting all the path variables leading to a broken machine and unhappy customers.
Any ideas?
I need to append a value to to the path environment variable - this is the path to some software that may (or may not) be previously installed. So I go to the registry and find out the app path for this piece of software, no problem.
I have then set up a property through the property manager, called ITPath, to hold this information and update it when the install is run. Using MsiSetProperty in my script this gets updated correctly. So far, so good...
Using the environment variables design view I set the value property of my path entry to [ITPath] - in the hope that this will be the value that I've set earlier in the script.
This, unfortunately, doesn't work.
It appears that this value property is set when the installer is built, not when it is run - I can put any old rubbish manually into the ITPath property at design time and this is then set as the environment variable, even though the property itself is being successfully updated when the install is run.
Is there anyway to get the value for an environment variable to update dynamically at install time?
I've also tried manually setting the path environment variable by writing directly to the registry in script, but when you then uninstall the program InstallShield then rather unhelpfully removes this entry, deleting all the path variables leading to a broken machine and unhappy customers.
Any ideas?
(1) Reply
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Dec 01, 2009
12:57 AM
We can do this in two steps,
1. “Behavior & Logic -> System Search”, give the key name what your are searching, store it in a secure custom property. Please check image1
2. “System configuration-> Environment Variable”, create an environment variable “Path”, in the value field mentioned the secure custom property that you created. Please check image 2.
1. “Behavior & Logic -> System Search”, give the key name what your are searching, store it in a secure custom property. Please check image1
2. “System configuration-> Environment Variable”, create an environment variable “Path”, in the value field mentioned the secure custom property that you created. Please check image 2.