cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
y_zhang
Level 3

Environment variables set is not visible within the session of installation

I created a install script project. The dependent DLL files were copied to a folder under common files folder instead of the system folder. During the installation, the path environment were set to point to this custom folder. When the installation is done, in the AfterFirstUIAfter event, a pop up window will ask the user to choose whether to run the application. If the user choose yes, the application fails because the dll files cannot be found. However, if the user run the application from outside the installer, everything is fine. Or, after quit the installation, the application works fine too. (No restart required).

It looks to me the installshield will not use the new environment variable during the installation process. Is there anyone has a solution for that? Thanks very much for your help.
Labels (1)
0 Kudos
(2) Replies
Christopher_Pai
Level 16

I know in MSI a custom action won't see the new environment because the service control manager that hosts msiexec doesn't refresh enviornment changes. I'm not sure about InstallScript.

Generally when I have this type of problem I modify the environment for the running process.

http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_kmmj.mspx?mfr=true

Instantiating a Shell Object from within InstallScript and then setting a process environment variable should make it available for whatever comes next in InstallScript.
0 Kudos
y_zhang
Level 3

Thank you, Christopher. I will try that.
0 Kudos