NSIS: using environment variable at compile time?
Asked Answered
A

1

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?

Awful answered 22/1, 2014 at 20:59 Comment(0)
M
11
!echo "$%temp%"

I'm pretty sure this is documented somewhere.

Marquise answered 22/1, 2014 at 23:27 Comment(2)
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.Awful
It is documented under "5.3 Read environment variables"Marquise

© 2022 - 2024 — McMap. All rights reserved.