Skip to content
⌘ NSIS Forum Archive

InstallDir onInit out ouf registry

2 posts

tarkinheld#

InstallDir onInit out ouf registry

Hi there,

I read all messages about this topic. But unfortunately it still doesn't work. I'm reading a value out of the registry in the onInit-Function. Then I set the InstallDir to this var.

But the field in the installation stays blank.


Anybody an idea?

Greetings
kichik#
The value you pass to InstallDir using:
InstallDir "C:\something\blah"
is processed when the installer loads, before .onInit so you can use $INSTDIR in .onInit. You should therefore copy the new value directly to $INSTDIR using:
StrCpy $INSTDIR $InstallDir
and not copy it to $R8.

You can also use InstallDirRegKey and then tweak $INSTDIR in .onInit instead of reading the registry yourself.