Bug 1343938 - Fix new installs erroneously not prompting to change the default browser setting. r?agashlin
MozReview-Commit-ID: EYPeEOE8Ldr
--- a/browser/installer/windows/nsis/installer.nsi
+++ b/browser/installer/windows/nsis/installer.nsi
@@ -551,16 +551,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 ""
AppAssocReg::QueryCurrentDefault "http" "protocol" "effective"
@@ -587,17 +588,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}