hdtvrocks
2nd December 2006 11:27 UTC
Reading Registry to find Default Install Dir?
Hi,
I'm trying to set the default install directory. The example script has:
; The default installation directory
InstallDir $PROGRAMFILES\Example1
So I added this:
Function .onInit
ReadRegStr $1 HKLM "registry\key" "subkey"
FunctionEnd
and then tried to use InstallDir $1 but this doesn't seem to work.
Can someone give me some suggestions?
Thanks.
kichik
2nd December 2006 11:31 UTC
Use InstallDirRegKey instead. It'll read the registry and only change $INSTDIR if the key exists and contains a valid value.
hdtvrocks
2nd December 2006 11:36 UTC
Originally posted by kichik
Use InstallDirRegKey instead. It'll read the registry and only change $INSTDIR if the key exists and contains a valid value.
Thanks that worked! Wasted so much time looking for how to do this... =(