Bug 1343938 - Fix new installs erroneously not prompting to change the default browser setting. r=agashlin, a=jcristau
authorMatt Howell <mhowell@mozilla.com>
Thu, 02 Mar 2017 10:55:24 -0800
changeset 355280 55b2513ee25301d82b026182953d1f273b7d8de5
parent 355279 2a6ced4d447da283b3c7f84d2da0956abb1dc683
child 355293 e91f28a35e2027dc9321f42a70f9d7148c6ed7d2
push id6928
push userryanvm@gmail.com
push dateWed, 08 Mar 2017 21:05:16 +0000
treeherdermozilla-esr52@55b2513ee253 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin, jcristau
bugs1343938
milestone52.0.1
Bug 1343938 - Fix new installs erroneously not prompting to change the default browser setting. r=agashlin, a=jcristau MozReview-Commit-ID: EYPeEOE8Ldr
browser/installer/windows/nsis/installer.nsi
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -589,16 +589,17 @@ SectionEnd
 
 ; Cleanup operations to perform at the end of the installation.
 Section "-InstallEndCleanup"
   SetDetailsPrint both
   DetailPrint "$(STATUS_CLEANUP)"
   SetDetailsPrint none
 
   ${Unless} ${Silent}
+    ClearErrors
     ${MUI_INSTALLOPTIONS_READ} $0 "summary.ini" "Field 4" "State"
     ${If} "$0" == "1"
       ; NB: this code is duplicated in stub.nsi. Please keep in sync.
       ; For data migration in the app, we want to know what the default browser
       ; value was before we changed it. To do so, we read it here and store it
       ; in our own registry key.
       StrCpy $0 ""
       ${If} ${AtLeastWinVista}
@@ -627,17 +628,17 @@ Section "-InstallEndCleanup"
       ${GetParameters} $0
       ${GetOptions} "$0" "/UAC:" $0
       ${If} ${Errors}
         Call SetAsDefaultAppUserHKCU
       ${Else}
         GetFunctionAddress $0 SetAsDefaultAppUserHKCU
         UAC::ExecCodeSegment $0
       ${EndIf}
-    ${Else}
+    ${ElseIfNot} ${Errors}
       ${LogHeader} "Writing default-browser opt-out"
       ClearErrors
       WriteRegStr HKCU "Software\Mozilla\Firefox" "DefaultBrowserOptOut" "True"
       ${If} ${Errors}
         ${LogMsg} "Error writing default-browser opt-out"
       ${EndIf}
     ${EndIf}
   ${EndUnless}