cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
PeterMasterton
Level 2

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?
Labels (1)
0 Kudos
(1) Reply
Not applicable

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.
0 Kudos