Skip to content
⌘ NSIS Forum Archive

ExpandEnvStrings usage

3 posts

Jonathan70#

ExpandEnvStrings usage

Hi,

I'm trying to substitute a pair of environment variables to use in the paths to select the files for the installer.

I assume that using ExpandEnvStrings is the way forward and can declare my rnv vars without issue. I can't seem to find any examples of how to use the $x in the script section.

I'm basically trying to achieve turning
​​​File /r c:\jonathan\folder-abcd\...

To

File /r $0\folder-$1\...

What is the correct syntax

Jonathan
Anders#
File "$%myvar%\foo\bar" is expanded on your computer.

SetOutPath sets where File extracts:

ReadEnvStr $1 MyVar
SetOutPath "$1\baz"
File ...