9

If I'm not mistaken, all discussion about environment variables (EVs) in NSIS docs (eg ReadEnvStr), deal with EVs in the target computer: all happens at install time.

I wonder if there is any support for accesing EVs on the developer (build) machine, at compile time. Specifically, suppose I have

!define SRCDIR "C:\progs\version1\src"

...
File /r "${SRCDIR}\*.*" 

and I'd rather want to write

!define SRCDIR "%{PROG_DIR}\src"

(or something similar), where PROG_DIR is an environment variable. Can this be done?

leonbloy
  • 73,180
  • 20
  • 142
  • 190

1 Answers1

11
!echo "$%temp%"

I'm pretty sure this is documented somewhere.

Anders
  • 97,548
  • 12
  • 110
  • 164
  • Well, it was indeed simple, but I didn't find it documented anywhere (nor even a mention to this distinction between env variables in target computer vs build computer). It works, thanks. – leonbloy Jan 23 '14 at 14:40
  • It is documented under "5.3 Read environment variables" – Anders Dec 02 '19 at 15:08