Archive: Environment Variables


Environment Variables
Hello,

i have a new problem. I write a new Environment-Variable in my installer like this

${EnvVarUpdate} $0 "VarName" "A" "HKLM" "$INSTDIR"
this works fine.

But later in my installer i start with ExecWait a .bat file which needs the EnVar "VarName".
ExecWait $INSTDIR\installService.bat

But the result is that the Service could not find the ${VarName}.


Could anyone please help me with my problem?

The problem is that when your installer starts another program that new program inherits the same environment as the installer (i.e. the new program will not see the new variable your installer has created).

The solution is simple - your installer must also make the new value available before it starts the new program.

The NSIS wiki explains how to do this: http://nsis.sourceforge.net/Setting_...ment_Variables (the "Setting Environmental Variables Temporarily" section tells you what to do)


It works. Thank you very very much ;-)


credit auto

:confused: :rolleyes: