PDA

View Full Version : System Variable as InstallDir


xcabur
20th May 2008, 14:58
Hello Together

I have a question and I hope you can help me. I want use the windows systemvariable %allusersprofile% as installdir variable in NSIS. But the systemvariable %allusersprofile% is not available as a default Constant. Is it possible to use this variable and set it as instaldir?

Thanks for Help

Red Wine
20th May 2008, 15:11
There's $profile which is set to all/current depending on the SetShellVarContext.

Here's an alternative:

Function .onInit
ReadENVStr $R0 ALLUSERSPROFILE
StrCpy $INSTDIR "$R0\My Application"
;;;;;;
;;;;;;

xcabur
20th May 2008, 15:33
Ah thanks. It works!