@@ -56,7 +56,7 @@ Var RadioButtonLabel1
56
56
!define MULTIUSER_INSTALLMODE_DISPLAYNAME " ${PRODUCT_NAME} ${VERSION}"
57
57
!endif
58
58
59
- RequestExecutionLevel user ; will ask elevation only if necessary
59
+ RequestExecutionLevel user
60
60
61
61
; Sets install mode to "per-machine" (all users).
62
62
!macro MULTIUSER_INSTALLMODE_ALLUSERS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX
@@ -157,7 +157,6 @@ FunctionEnd
157
157
!macroend
158
158
159
159
!macro MULTIUSER_INIT_CHECKS UNINSTALLER_PREFIX UNINSTALLER_FUNCPREFIX
160
-
161
160
; Installer initialization - check privileges and set default install mode
162
161
!insertmacro MULTIUSER_INIT_TEXTS
163
162
@@ -170,10 +169,10 @@ FunctionEnd
170
169
StrCpy $IsAdmin 0
171
170
${endif}
172
171
173
- ; Checks registry for previous installation path (both for upgrading, reinstall, or uninstall)
172
+ # checks registry for previous installation path (both for upgrading, reinstall, or uninstall)
174
173
StrCpy $HasPerMachineInstallation 0
175
174
StrCpy $HasPerUserInstallation 0
176
- ; Set installation mode to setting from a previous installation
175
+ # set installation mode to setting from a previous installation
177
176
ReadRegStr $PerMachineInstallationFolder HKLM " ${MULTIUSER_INSTALLMODE_INSTALL_REGISTRY_KEY2}" " ${MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME}"
178
177
${if} $PerMachineInstallationFolder != " "
179
178
StrCpy $HasPerMachineInstallation 1
@@ -189,24 +188,13 @@ FunctionEnd
189
188
${elseif} $HasPerUserInstallation == " 0" ; if there is only one installation... set it as default...
190
189
${andif} $HasPerMachineInstallation == " 1"
191
190
Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.AllUsers
192
- ${else} ; if there is no installation, or there is both per-user and per-machine...
193
- ${if} ${IsNT}
194
- ${if} $IsAdmin == " 1" ; If running as admin, default to per-machine installation if possible (unless default is forced by MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER)
195
- !if MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
196
- Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.CurrentUser
197
- !else
198
- Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.AllUsers
199
- !endif
200
- ${else} ; If not running as admin, default to per-user installation (unless default is forced by MULTIUSER_INSTALLMODE_DEFAULT_ALLUSERS and elevation is allowed MULTIUSER_INSTALLMODE_ALLOW_ELEVATION)
201
- !ifdef MULTIUSER_INSTALLMODE_DEFAULT_ALLUSERS & MULTIUSER_INSTALLMODE_ALLOW_ELEVATION
202
- Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.AllUsers
203
- !else
204
- Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.CurrentUser
205
- !endif
206
- ${endif}
207
- ${else} ; Not running Windows NT, (so it's Windows XP at best), so per-user installation not supported
208
- Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.AllUsers
209
- ${endif}
191
+ ${else}
192
+ # if there is no installation, or there is both per-user and per-machine
193
+ !ifdef INSTALL_MODE_PER_ALL_USERS
194
+ Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.AllUsers
195
+ !else
196
+ Call ${UNINSTALLER_FUNCPREFIX} MultiUser.InstallMode.CurrentUser
197
+ !endif
210
198
${endif}
211
199
212
200
!macroend
@@ -215,7 +203,6 @@ FunctionEnd
215
203
!verbose push
216
204
!verbose 3
217
205
218
- ; se for inner (sub processo) e ainda assim não for admin... algo errado
219
206
${If} ${UAC_IsInnerInstance}
220
207
${AndIfNot} ${UAC_IsAdmin}
221
208
; MessageBox MB_OK "This account doesn't have admin rights"
@@ -353,7 +340,6 @@ FunctionEnd
353
340
${NSD_CreateRadioButton} 10u 50u 280u 20u " $9 ($0)"
354
341
Pop $MultiUser .InstallModePage.CurrentUser
355
342
356
-
357
343
nsDialogs::SetUserData $MultiUser .InstallModePage.AllUsers 1 ; Install for All Users (1, pra exibir o icone SHIELD de elevation)
358
344
nsDialogs::SetUserData $MultiUser .InstallModePage.CurrentUser 0 ; Install for Single User (0 pra não exibir)
359
345
@@ -369,8 +355,6 @@ FunctionEnd
369
355
; ${NSD_CreateLabel} 0u 130u 280u 20u ""
370
356
; Pop $RadioButtonLabel3
371
357
372
-
373
-
374
358
${if} $MultiUser .InstallMode == " AllUsers" ; setting defaults
375
359
SendMessage $MultiUser .InstallModePage.AllUsers ${BM_SETCHECK} ${BST_CHECKED} 0 ; set as default
376
360
SendMessage $MultiUser .InstallModePage.AllUsers ${BM_CLICK} 0 0 ; trigger click event
@@ -473,13 +457,11 @@ FunctionEnd
473
457
${endif}
474
458
${endif}
475
459
SendMessage $RadioButtonLabel1 ${WM_SETTEXT} 0 " STR:$7"
476
- ; SendMessage $RadioButtonLabel2 ${WM_SETTEXT} 0 "STR:$8"
477
- ; SendMessage $RadioButtonLabel3 ${WM_SETTEXT} 0 "STR:$9"
478
460
FunctionEnd
479
461
480
462
!macroend
481
463
482
- ; SHCTX is the hive HKLM if SetShellVarContext all, or HKCU if SetShellVarContext user
464
+ # SHCTX is the hive HKLM if SetShellVarContext all, or HKCU if SetShellVarContext user
483
465
!macro MULTIUSER_RegistryAddInstallInfo
484
466
!verbose push
485
467
!verbose 3
0 commit comments