Bug 1343938 - Fix new installs erroneously not prompting to change the default browser setting. r=agashlin, a=sledru
authorMatt Howell <mhowell@mozilla.com>
Thu, 02 Mar 2017 10:55:24 -0800
changeset 376633 69efeba94b307f236a50a9e5fdd2bbd2e946657b
parent 376632 a94edff8355a1c83ad2bfad80d48540a3cfdfcf6
child 376634 24e55649c9a5f71d27d21730c5180812c60ff9fe
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersagashlin, sledru
bugs1343938
milestone53.0a2
Bug 1343938 - Fix new installs erroneously not prompting to change the default browser setting. r=agashlin, a=sledru 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}