Installer: Ignore failed installs if user has no admin rights (#4760)
It's better to attempt to install into existing folder with some junk left over than to leave users in a reboot loop
This commit is contained in:
parent
f2367c88f5
commit
a36e0a88f6
1 changed files with 22 additions and 8 deletions
|
@ -618,19 +618,33 @@ Function AddQuickLaunchShortcut
|
|||
FunctionEnd
|
||||
|
||||
Function CheckExistingInstall
|
||||
UserInfo::GetAccountType
|
||||
pop $0 ; $0 = "Admin" or "User" or "Guest". This is the account type.
|
||||
|
||||
; If there is a pending file copy from a previous upgrade don't allow
|
||||
; installing until after the system has rebooted.
|
||||
IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +4
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
${If} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-upgrade"
|
||||
StrCmp $0 "Admin" +1 +4
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
; Non-admins cannot depend on files being removed on restart.
|
||||
; Our only option is to remove these files and continue with the installation.
|
||||
Delete "$INSTDIR\${FileMainEXE}.moz-upgrade"
|
||||
Delete "$INSTDIR\${FileMainEXE}"
|
||||
${EndIf}
|
||||
|
||||
; If there is a pending file deletion from a previous uninstall don't allow
|
||||
; installing until after the system has rebooted.
|
||||
IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +4
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
${If} ${FileExists} "$INSTDIR\${FileMainEXE}.moz-delete"
|
||||
StrCmp $0 "Admin" +1 +4
|
||||
MessageBox MB_YESNO|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +2
|
||||
Reboot
|
||||
Quit
|
||||
; Non-admins cannot depend on files being removed on restart.
|
||||
Delete "$INSTDIR\${FileMainEXE}.moz-delete"
|
||||
Delete "$INSTDIR\${FileMainEXE}"
|
||||
${EndIf}
|
||||
|
||||
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
|
||||
; Disable the next, cancel, and back buttons
|
||||
|
|
Loading…
Add table
Reference in a new issue