Bug 1353955 - Fix making ourselves the default browser on Windows 7. r=agashlin

This fixes a regression from bug 1324617. We were setting all our file and
protocol associations correctly, but failing to invoke SetAppAsDefaultAll,
meaning we act like the default browser (as in, links and files opened from
external applications go to us), but we don't detect ourselves as the default
browser, and the previous default browser still thinks it's the default.

This only applies to Windows 7 because later versions don't allow us to make
ourselves the default browser anyway.

MozReview-Commit-ID: 29iWvzicce9

--HG--
extra : rebase_source : 1ad06799f1d1447386ec6ce1a242552ccf748f1d
This commit is contained in:
Matt Howell 2017-04-06 15:57:32 -07:00
parent 62cdf603c8
commit b51bc18a35

View File

@ -1310,9 +1310,26 @@
; easily called from an elevated instance of the binary. Since this can be
; called by an elevated instance logging is not performed in this function.
Function SetAsDefaultAppUserHKCU
; See if we're using path hash suffixed registry keys for this install
${GetLongPath} "$INSTDIR\${FileMainEXE}" $8
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
${OrIf} ${AtMostWin2008R2}
ClearErrors
ReadRegStr $0 HKLM "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${EndIf}
StrCpy $0 $0 -2
${If} $0 != $8
${If} $AppUserModelID == ""
${InitHashAppModelId} "$INSTDIR" "Software\Mozilla\${AppName}\TaskBarIDs"
${EndIf}
StrCpy $R9 "${AppRegName}-$AppUserModelID"
${EndIf}
; Only set as the user's StartMenuInternet browser if the StartMenuInternet
; registry keys are for this install.
StrCpy $R9 "${AppRegName}-$AppUserModelID"
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}
@ -1323,7 +1340,6 @@ Function SetAsDefaultAppUserHKCU
${Unless} ${Errors}
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9"
${Else}
${StrFilter} "${FileMainEXE}" "+" "" "" $R9
ClearErrors
ReadRegStr $0 HKCU "Software\Clients\StartMenuInternet\$R9\DefaultIcon" ""
${If} ${Errors}