Skip to content
⌘ NSIS Forum Archive

How to get environment variable at runtime?

3 posts

rmsh#

How to get environment variable at runtime?

Hi

I want my installer to install into C:\My_Product folder. Instead of hardcoding C:\, I wanted to use %SYSTEMDRIVE%... But apparently if I use %SYSTEMDRIVE% it is resolved at the compile time but not runtime. Also NSIS doesn't let me use $SYSTEMDRIVE, it gives me a warning saying this variable is unresolved and is ignored!.

Any thoughts....

- Ramesh
Takhir#
Please read NSIS manual 4.2.3 Constants and 4.9.8.1 StrCpy. Use first 3 chars from $WINDIR.