mirror of
https://github.com/reactos/CMake.git
synced 2025-02-21 12:20:48 +00:00
ENH: use radio buttons to choose PATH options
This commit is contained in:
parent
da8403a163
commit
5b3a2c84fc
@ -1,5 +1,5 @@
|
||||
[Settings]
|
||||
NumFields=3
|
||||
NumFields=4
|
||||
|
||||
[Field 1]
|
||||
Type=label
|
||||
@ -10,20 +10,28 @@ Top=0
|
||||
Bottom=20
|
||||
|
||||
[Field 2]
|
||||
Type=checkbox
|
||||
Text=Check this option to add the path to the system PATH
|
||||
Type=radiobutton
|
||||
Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH
|
||||
Left=0
|
||||
Right=-1
|
||||
Top=30
|
||||
Bottom=40
|
||||
State=0
|
||||
State=1
|
||||
|
||||
[Field 3]
|
||||
Type=checkbox
|
||||
Text=If administrator, add to the PATH for all users.
|
||||
Type=radiobutton
|
||||
Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users
|
||||
Left=0
|
||||
Right=-1
|
||||
Top=40
|
||||
Bottom=50
|
||||
State=1
|
||||
State=0
|
||||
|
||||
[Field 4]
|
||||
Type=radiobutton
|
||||
Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user
|
||||
Left=0
|
||||
Right=-1
|
||||
Top=50
|
||||
Bottom=60
|
||||
State=0
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user