Skip to content

Commit e0154c2

Browse files
authored
Installer should not hardcode the installdir path
This changes $INSTDIR to respect InstallDirRegKey. If not present, the default is the drive of %ProgramFiles% instead of forcing c:\.
1 parent 7ae7c50 commit e0154c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

RosBE-Windows/RosBE.nsi

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ Function .onInit
5252
StrCmp $R0 0 +3
5353
MessageBox MB_OK|MB_ICONEXCLAMATION "The ${PRODUCT_NAME} v${PRODUCT_VERSION} installer is already running."
5454
Abort
55-
StrCpy $INSTDIR "C:\RosBE"
55+
56+
${If} $INSTDIR == "" ; InstallDirRegKey not valid?
57+
StrCpy $0 $ProgramFiles 1
58+
StrCpy $INSTDIR "$0:\RosBE"
59+
${EndIf}
60+
5661
Call UninstallPrevious
5762
!insertmacro INSTALLOPTIONS_EXTRACT "RosSourceDir.ini"
5863
FunctionEnd

0 commit comments

Comments
 (0)