Skip to content
⌘ NSIS Forum Archive

Passing NSIS constat at runtime ...

4 posts

kobus#

Passing NSIS constat at runtime ...

I've got an installer that read default directories from
ini file during instalation and then give a chance to the
user to change it.

I want to set default dir to c:\windows\system directory
[NSIS constant $SYSDIR].
...
[section_xxx]
default_dir="$SYSDIR"
...
When I read it from INI file I've got variable $Dir with value "$SYSDIR". Is it possible to make installer to substitute $SYSDIR by real path to system directory. (something similar to indirect addressing) ?
Joost Verburg#
Use a value like %SystemRoot% and then change it to $SYSDIR.
StrCmp $Dir "%SystemRoot%" 0 +2
StrCpy $DIR $SYSDIR
kobus#
That's the way I finally did it.
I wonder if there is something like "indirect addressing" possible in NSIS scripting languge ...

If not, maybe it is worth of thinking about such a feature
in NSIS 3.0 🙂

Thanks Joost and keep doing good work 👍

Kobus