Environment and Path Variables in InstallShield

For whatever reason I have either never had a reason to use an Environment Variable for a Path Variable in InstallShield before now, or it’s been long enough that I forgot how to do it so this morning when I went in to try and set one up I was a bit surprised to find it to not be quite as straightforward as I thought it might be.

I had originally just gone straight to the Path Variables section of the IDE [EDIT: after creating the environment variable before starting InstallShield] and created a new Path Variable entry and changed the type to “Environment” however no matter what I did I could not get it to resolve to the value of the Environment Variable that I had already created. The help files were no help and I didn’t see anything in a quick search on the InstallShield Community Forums (which are normally a great resource for exactly this sort of problem). I had been using InstallShield 2009 Professional and verified that it worked the same ways in 2010 and 2011. Eventually I stumbled on to this method:

  1. Create the environment variable on the system first through the usual methods.
  2. Open the InstallShield project that you want to use the variable in. (If you have the project open when you create the variable it does not always propagate until you’ve restarted InstallShield. It’s a fairly consistent problem with Windows environment variables.)
  3. In Tools | Options on the Path Variables tab, make sure you have either “Always recommend…” or “Always display…” selected. If you want to use an environment variable that an existing path variable points to you will want to either modify/delete the existing path variable or have the option set to “Always display…”.
  4. Add or modify the location of a file in some part of the IDE and use the environment variable in the “Browse for File dialog”. This could be in a component or in something like the signing certificate file location in the Release settings.
  5. When the “Path Variable Recommendation” dialog appears make sure to select “Create a new path…” and enter a name that is identical to the environment variable you want to use.
  6. Go to the Path Variables section of the IDE and change the Type for the new variable to “Environment”.

If you did everything properly the “Current Value” field should immediately change to “” where “VARIABLENAME” is the name of the environment variable that you are referencing.

If someone knows of an easier way of doing this I’d love to hear about it!

Author: Cavorter

Recently divorced SWM seeks, um, stuff. (Formerly used the handle: Glyph)

3 thoughts on “Environment and Path Variables in InstallShield”

  1. “I had originally just gone straight to the Path Variables section of the IDE and created a new entry and changed the type to “Environment”…”

    1. Do that (above).
    2. Save the changes, close and restart IS.

    The problem occurs if you create a new environment variable while you have the IDE open because creating the new env var does not “broadcast” the change to currently running processes (such as isdev.exe). For the IDE to “see” the new env var you have to stop and restart the process. I think most applications work this way too (for example, that’s why you can’t set an env var during an MSI install and reference the new env var before the install has completed – b/c the change isn’t “broadcast” to the already running msiexec.exe process).

  2. I left out a bit: The environment variable was already created before starting up InstallShield and it still won’t resolve as anything useful unless I go through the process outlined. I might make an edit in the post to reflect that…
  3. Ugh, this problem has haunted me. I have bought the steps you’ve outline, and what colby has suggested and every variation in between with no results. Which is very annoying for the amount of money paid for this this piece of software. Could you provide a screen shot of your Path Variables page so that I don’t feel like a complete bone head?

    Thanks. :neutral:

Comments are closed.