cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Not applicable

Environment Variables in Vista

We are running into a problem where environment variables set within a command prompt are not defined for the installer when the installer is invoked from that command prompt. This is only happening when run on Vista.

For example, if we run the following from a command prompt on Vista:
set CONFIG_FILE=c:\custom_install.properties
setup.exe

The environment variable CONFIG_FILE is not defined when we try to access it during installation. We rely on this to know when the user wants to run in configuration mode, where they can create a custom install properties file.

Has anyone else seen this and have a workaround? We are using InstallAnywhere 8.0.1
Labels (1)
0 Kudos
(3) Replies
pv7721
Level 20

If you want your installer to read from the properties file you mentioned, the simplest way would be to launch your installer like this:
setup.exe -f c:\custom_install.properties
0 Kudos
Not applicable

We're actually not trying to read from an existing properties file, we are trying to generate a properties file. Our installer has a configuration mode, where we ask the user questions about the type of custom installer properties file that they would like to create. For example, we ask them which components they would like to be available, enabled, selected, etc. Based on their answers, we write out a custom install properties file to be used later as you suggested (setup.exe -f custom_install.properties). Our installer relies on the existence of an environment variable to know to run in configuration mode, rather than the normal installation mode. For some reason, when running on Vista, if the installer is run in a command prompt where the environment variable has been defined, it is not defined in the installer's environment.
0 Kudos
sandyqudie
Level 3

We ran into the same problem on Vista and Windows 2008. The work around is to set it in the Windows "Environment Variables" screen instead.

But if anybody figure out how to make it work setting it in the command prompt, I would like to know.
0 Kudos