Bug 615131 - Installer crashes if 'Next' button is clicked while 'Looking for existing installation...' dialog is displayed. r=jmathies, a=approval2.0
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 21 Dec 2010 16:32:01 -0800
changeset 59583 ae9c1e421a164d4bf4bd60eb3fb8b65d4e47358f
parent 59582 3e4f01f2a119377f642a0dec4705312187304eeb
child 59584 875e5ea752417b0cb408f9409caf77bc4d3274fb
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersjmathies, approval2
bugs615131
milestone2.0b9pre
Bug 615131 - Installer crashes if 'Next' button is clicked while 'Looking for existing installation...' dialog is displayed. r=jmathies, a=approval2.0
browser/installer/windows/nsis/installer.nsi
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -591,30 +591,46 @@ Function CheckExistingInstall
   ; 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}"
+    ; Disable the next, cancel, and back buttons
+    GetDlgItem $0 $HWNDPARENT 1 ; Next button
+    EnableWindow $0 0
+    GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
+    EnableWindow $0 0
+    GetDlgItem $0 $HWNDPARENT 3 ; Back button
+    EnableWindow $0 0
+
     Banner::show /NOUNLOAD "$(BANNER_CHECK_EXISTING)"
 
     ${If} "$TmpVal" == "FoundMessageWindow"
       Sleep 5000
     ${EndIf}
 
     ${PushFilesToCheck}
 
     ; Store the return value in $TmpVal so it is less likely to be accidentally
     ; overwritten elsewhere.
     ${CheckForFilesInUse} $TmpVal
 
     Banner::destroy
 
+    ; Enable the next, cancel, and back buttons
+    GetDlgItem $0 $HWNDPARENT 1 ; Next button
+    EnableWindow $0 1
+    GetDlgItem $0 $HWNDPARENT 2 ; Cancel button
+    EnableWindow $0 1
+    GetDlgItem $0 $HWNDPARENT 3 ; Back button
+    EnableWindow $0 1
+
     ${If} "$TmpVal" == "true"
       StrCpy $TmpVal "FoundMessageWindow"
       ${ManualCloseAppPrompt} "${WindowClass}" "$(WARN_MANUALLY_CLOSE_APP_INSTALL)"
       StrCpy $TmpVal "true"
     ${EndIf}
   ${EndIf}
 FunctionEnd