summaryrefslogtreecommitdiffstats
path: root/Modules/NSIS.template.in
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-05-10 16:15:00 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-05-10 16:15:00 (GMT)
commit5b3a2c84fc26bc74e36ecb187aa4456025fe45ea (patch)
treea7062f9386cd02f272d6494cdb27280a410aaa8a /Modules/NSIS.template.in
parentda8403a163358de3dab57fdd9a0cc3ec8fdf2b60 (diff)
downloadCMake-5b3a2c84fc26bc74e36ecb187aa4456025fe45ea.zip
CMake-5b3a2c84fc26bc74e36ecb187aa4456025fe45ea.tar.gz
CMake-5b3a2c84fc26bc74e36ecb187aa4456025fe45ea.tar.bz2
ENH: use radio buttons to choose PATH options
Diffstat (limited to 'Modules/NSIS.template.in')
-rw-r--r--Modules/NSIS.template.in27
1 files changed, 18 insertions, 9 deletions
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 0cae5c6..2994c78 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -14,8 +14,9 @@
Var STARTMENU_FOLDER
Var SV_ALLUSERS
Var START_MENU
- Var ADD_TO_PATH
+ Var DO_NOT_ADD_TO_PATH
Var ADD_TO_PATH_ALL_USERS
+ Var ADD_TO_PATH_CURRENT_USER
;--------------------------------
;Include Modern UI
@@ -66,6 +67,7 @@ Function .onInit
StrCmp "@CPACK_NSIS_MODIFY_PATH@" "ON" 0 noOptionsPage
!insertmacro MUI_INSTALLOPTIONS_EXTRACT "NSIS.InstallOptions.ini"
+
noOptionsPage:
FunctionEnd
@@ -441,9 +443,10 @@ FunctionEnd
Section "Add to path"
Push $INSTDIR\bin
;Read a value from an InstallOptions INI file
- !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
+ !insertmacro MUI_INSTALLOPTIONS_READ $DO_NOT_ADD_TO_PATH "NSIS.InstallOptions.ini" "Field 2" "State"
!insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_ALL_USERS "NSIS.InstallOptions.ini" "Field 3" "State"
- StrCmp $ADD_TO_PATH "1" 0 doNotAddToPath
+ !insertmacro MUI_INSTALLOPTIONS_READ $ADD_TO_PATH_CURRENT_USER "NSIS.InstallOptions.ini" "Field 4" "State"
+ StrCmp $DO_NOT_ADD_TO_PATH "1" doNotAddToPath 0
Call AddToPath
doNotAddToPath:
SectionEnd
@@ -498,12 +501,15 @@ Section "Installer Section" InstSection
Push "StartMenu"
Push "$STARTMENU_FOLDER"
Call ConditionalAddToRegisty
- Push "AddToPath"
- Push "$ADD_TO_PATH"
+ Push "DoNotAddToPath"
+ Push "$DO_NOT_ADD_TO_PATH"
Call ConditionalAddToRegisty
Push "AddToPathAllUsers"
Push "$ADD_TO_PATH_ALL_USERS"
Call ConditionalAddToRegisty
+ Push "AddToPathCurrentUser"
+ Push "$ADD_TO_PATH_CURRENT_USER"
+ Call ConditionalAddToRegisty
@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@
@@ -516,6 +522,7 @@ SectionEnd
Function InstallOptionsPage
!insertmacro MUI_HEADER_TEXT "Install Options" "Chose options for installing @CPACK_PACKAGE_INSTALL_DIRECTORY@"
!insertmacro MUI_INSTALLOPTIONS_DISPLAY "NSIS.InstallOptions.ini"
+
FunctionEnd
;--------------------------------
@@ -550,11 +557,13 @@ Section "Uninstall"
ReadRegStr $START_MENU SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "StartMenu"
;MessageBox MB_OK "Start menu is in: $START_MENU"
- ReadRegStr $ADD_TO_PATH SHCTX \
- "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPath"
+ ReadRegStr $DO_NOT_ADD_TO_PATH SHCTX \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "DoNotAddToPath"
ReadRegStr $ADD_TO_PATH_ALL_USERS SHCTX \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathAllUsers"
- ;MessageBox MB_OK "Add to path: $ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
+ ReadRegStr $ADD_TO_PATH_CURRENT_USER SHCTX \
+ "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_DIRECTORY@" "AddToPathCurrentUser"
+ ;MessageBox MB_OK "Add to path: $DO_NOT_ADD_TO_PATH all users: $ADD_TO_PATH_ALL_USERS"
@CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS@
@@ -613,7 +622,7 @@ Section "Uninstall"
DeleteRegKey /ifempty SHCTX "Software\@CPACK_PACKAGE_VENDOR@\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@"
Push $INSTDIR\bin
- StrCmp $ADD_TO_PATH "1" 0 doNotRemoveFromPath
+ StrCmp $DO_NOT_ADD_TO_PATH_ "1" doNotRemoveFromPath 0
Call un.RemoveFromPath
doNotRemoveFromPath:
SectionEnd