Windows installer: Add option to remove installdir when previous installation detected (#4564)
Some checks are pending
CI / Build, Upload, Test (push) Waiting to run

This commit is contained in:
Tom Najdek 2024-08-14 10:53:19 +02:00 committed by GitHub
parent f5af1898fd
commit ca83e4303c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 4 deletions

Binary file not shown.

View file

@ -606,17 +606,27 @@ FunctionEnd
Function CheckExistingInstall
; 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
IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +5
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UPGRADE)" IDNO +3 IDCANCEL +2
Reboot
Quit
RMDir /r $INSTDIR
IfFileExists "$INSTDIR\${FileMainEXE}.moz-upgrade" +1 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to remove the previous installation. Please delete $INSTDIR and try again."
Quit
; 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
IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +5
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION "$(WARN_RESTART_REQUIRED_UNINSTALL)" IDNO +3 IDCANCEL +2
Reboot
Quit
RMDir /r $INSTDIR
IfFileExists "$INSTDIR\${FileMainEXE}.moz-delete" +1 +3
MessageBox MB_OK|MB_ICONEXCLAMATION "Failed to remove the previous installation. Please delete $INSTDIR and try again."
Quit
${If} ${FileExists} "$INSTDIR\${FileMainEXE}"
; Disable the next, cancel, and back buttons