summaryrefslogtreecommitdiffstats
path: root/Modules/NSIS.template.in
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2009-10-26 21:14:56 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2009-10-26 21:14:56 (GMT)
commit7d9e5b88ffaa0e511b0f1282dee2ed262142d269 (patch)
tree186e15cde460c3b5ce44fde513fd8ae2e5157732 /Modules/NSIS.template.in
parent20fe27cda19708f4bbc92b081d3d5eaaaee015ae (diff)
downloadCMake-7d9e5b88ffaa0e511b0f1282dee2ed262142d269.zip
CMake-7d9e5b88ffaa0e511b0f1282dee2ed262142d269.tar.gz
CMake-7d9e5b88ffaa0e511b0f1282dee2ed262142d269.tar.bz2
Allow for /D to change install directory on the command line.
Diffstat (limited to 'Modules/NSIS.template.in')
-rw-r--r--Modules/NSIS.template.in20
1 files changed, 16 insertions, 4 deletions
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index c18104d..d90967d 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -18,7 +18,7 @@
Var ADD_TO_PATH_ALL_USERS
Var ADD_TO_PATH_CURRENT_USER
Var INSTALL_DESKTOP
-
+ Var IS_DEFAULT_INSTALLDIR
;--------------------------------
;Include Modern UI
@@ -892,8 +892,19 @@ Function .onInit
; Reads components status for registry
!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 $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
UserInfo::GetName
@@ -917,8 +928,9 @@ Function .onInit
;Get installation folder from registry if available
done:
- StrCmp $SV_ALLUSERS "AllUsers" 0 +2
- StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
+ StrCmp $SV_ALLUSERS "AllUsers" 0 +3
+ StrCmp "$IS_DEFAULT_INSTALLDIR" "1" 0 +2
+ StrCpy $INSTDIR "$PROGRAMFILES\@CPACK_PACKAGE_INSTALL_DIRECTORY@"
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"