Archive: default dir


default dir
i'm calling:
Function .onInit
ReadRegStr $INSTDIR HKLM "Software\softcmd" "xtc"
StrCmp $INSTDIR "" 0 NoAbort
NoAbort:
FunctionEnd

in case when string empty, how can i define the default install path?


Use InstallDirRegKey.


and then where to define the default path?


Define the default path using InstallDir.


i want installer in each installation to write in registry InstallDir. as you see it always writes $PROGRAMFILES\x even i define other dir in directory page

im using:
InstallDir $PROGRAMFILES\x
InstallDirRegKey HKCU Software\x "xtc"

Function .onInit
WriteRegStr HKCU Software\x "x" "$INSTDIR"
StrCmp $INSTDIR "" 0 NoAbort
NoAbort:
FunctionEnd


Use WriteRegStr in a blank Section instead.
The .onInit function is called when loading the installer.

-Stu


thx. now im happy)