hohausfn
18th June 2009 13:02 UTC
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?
pengyou
18th June 2009 14:12 UTC
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)
hohausfn
18th June 2009 14:27 UTC
It works. Thank you very very much ;-)
lanlananhanh
7th July 2009 06:06 UTC
credit auto
:confused: :rolleyes: