Archive: Trouble setting environment variables and execwait


Trouble setting environment variables and execwait
I am building a pretty large install (>600M), which contains several other installers (Apache, Firefox, etc.) which I kick off using ExecWait. I recently added a change to logging in an attempt to make the installer compatible with the non-logging special build using a set of macros:

!macro Logger What
!ifdef NSIS_CONFIG_LOG
LogSet "${What}"
!endif
!macroend

!macro Log What
!ifdef NSIS_CONFIG_LOG
LogText "${What}"
!endif
!macroend

Then later...
!insertmacro Logger on
!insertmacro Log "User chose NOT to install (chickened out...)"

I assume this is legal, but I am not sure.

The root of my problem, is the customer I am delivering the install to, is claiming that the environment variables are not being set, and that firefox is not being installed.

So, I have been looking through the install.log, where it seems like it is doing the right thing, but I can't be sure...

Setting environment variables
Call: 4276
Call: 4326
WriteRegExpandStr: "HKEY_CURRENT_USER\Environment" "DON"="C:\od4\DON"
Call: 4276
Call: 4326
WriteRegExpandStr: "HKEY_CURRENT_USER\Environment" "DON_BIN"="%DON%\bin"
Call: 4276
Call: 4326
WriteRegExpandStr: "HKEY_CURRENT_USER\Environment" "DON_CGI"="%DON%\cgi-bin"
Call: 4300

And the code for this...
!insertmacro Log "Setting environment variables"
Push "DON"
Push "C:\od4\DON"
Call WriteEnvStr
Push "DON_BIN"
Push "%DON%\bin"
Call WriteEnvStr
Push "DON_CGI"
Push "%DON%\cgi-bin"
Call WriteEnvStr

So, how do I get the return values for these calls to know if it succeeded or not?

Here is how I handled the firefox install:
ExecWait '"$INSTDIR\install\Firefox Setup 2.0.0.1.exe" /S /D=c:\usr\local\bin\Firefox' $0
!insertmacro Log "Firefox external install returned $0..."

Thanks in advance,

-Kevin


For the next version I made WriteReg* report errors to the log instead of failing silently.

For now, you can use IfErrors in WriteEnvStr to check for error and print that to the log.