PDA

View Full Version : Passing NSIS constat at runtime ...


kobus
18th February 2004, 10:08
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
18th February 2004, 12:56
Use a value like %SystemRoot% and then change it to $SYSDIR.
StrCmp $Dir "%SystemRoot%" 0 +2
StrCpy $DIR $SYSDIR

kobus
18th February 2004, 13:04
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 :up:

Kobus

Joost Verburg
18th February 2004, 13:07
Features requests can be submitted at the project page.