Allow for /D to change install directory on the command line.
This commit is contained in:
parent
20fe27cda1
commit
7d9e5b88ff
|
@ -18,7 +18,7 @@
|
||||||
Var ADD_TO_PATH_ALL_USERS
|
Var ADD_TO_PATH_ALL_USERS
|
||||||
Var ADD_TO_PATH_CURRENT_USER
|
Var ADD_TO_PATH_CURRENT_USER
|
||||||
Var INSTALL_DESKTOP
|
Var INSTALL_DESKTOP
|
||||||
|
Var IS_DEFAULT_INSTALLDIR
|
||||||
;--------------------------------
|
;--------------------------------
|
||||||
;Include Modern UI
|
;Include Modern UI
|
||||||
|
|
||||||
|
@ -892,8 +892,19 @@ Function .onInit
|
||||||
; Reads components status for registry
|
; Reads components status for registry
|
||||||
!insertmacro SectionList "InitSection"
|
!insertmacro SectionList "InitSection"
|
||||||
|
|
||||||
|
; check to see if /D has been used to change
|
||||||
|
; the install directory by comparing it to the
|
||||||
|
; install directory that is expected to be the
|
||||||
|
; default
|
||||||
|
StrCpy $IS_DEFAULT_INSTALLDIR 0
|
||||||
|
StrCmp "$INSTDIR" "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@" 0 +2
|
||||||
|
StrCpy $IS_DEFAULT_INSTALLDIR 1
|
||||||
|
|
||||||
StrCpy $SV_ALLUSERS "JustMe"
|
StrCpy $SV_ALLUSERS "JustMe"
|
||||||
StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
|
; if default install dir then change the default
|
||||||
|
; if it is installed for JustMe
|
||||||
|
StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
|
||||||
|
StrCpy $INSTDIR "$DOCUMENTS\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
|
||||||
|
|
||||||
ClearErrors
|
ClearErrors
|
||||||
UserInfo::GetName
|
UserInfo::GetName
|
||||||
|
@ -917,8 +928,9 @@ Function .onInit
|
||||||
;Get installation folder from registry if available
|
;Get installation folder from registry if available
|
||||||
|
|
||||||
done:
|
done:
|
||||||
StrCmp $SV_ALLUSERS "AllUsers" 0 +2
|
StrCmp $SV_ALLUSERS "AllUsers" 0 +3
|
||||||
StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
|
StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
|
||||||
|
StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
|
||||||
|
|
||||||
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
|
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
|
||||||
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
|
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
|
||||||
|
|
Loading…
Reference in New Issue