Skip to content
⌘ NSIS Forum Archive

default dir

7 posts

whiter#

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?
whiter#
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
Afrow UK#
Use WriteRegStr in a blank Section instead.
The .onInit function is called when loading the installer.

-Stu