Bug 447928 - HKCU protocol / file handlers won't be updated after update or during an in place upgrade. r=jmathies

This commit is contained in:
Robert Strong 2008-07-27 18:58:27 -07:00
parent 1b3f948078
commit 82aa07c5f2
3 changed files with 16 additions and 15 deletions

View File

@ -349,6 +349,7 @@ Section "-Application" APP_IDX
SetShellVarContext current ; Set SHCTX to HKCU
${RegCleanMain} "Software\Mozilla"
${RegCleanUninstall}
${UpdateProtocolHandlers}
ClearErrors
WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test"
@ -360,6 +361,7 @@ Section "-Application" APP_IDX
StrCpy $TmpVal "HKLM" ; used primarily for logging
${RegCleanMain} "Software\Mozilla"
${RegCleanUninstall}
${UpdateProtocolHandlers}
ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion"
${If} "$0" != "${GREVersion}"
@ -385,7 +387,6 @@ Section "-Application" APP_IDX
${WriteRegDWORD2} $TmpVal "$0" "Create Start Menu Shortcut" $AddStartMenuSC 0
${FixClassKeys}
${UpdateProtocolHandlers}
; On install always add the FirefoxHTML and FirefoxURL keys.
; An empty string is used for the 5th param because FirefoxHTML is not a

View File

@ -41,6 +41,7 @@
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
${RegCleanMain} "Software\Mozilla"
${RegCleanUninstall}
${UpdateProtocolHandlers}
ClearErrors
WriteRegStr HKLM "Software\Mozilla\InstallerTest" "InstallerTest" "Test"
@ -55,6 +56,7 @@
${SetStartMenuInternet}
${FixShellIconHandler}
${SetUninstallKeys}
${UpdateProtocolHandlers}
ReadRegStr $0 HKLM "Software\mozilla.org\Mozilla" "CurrentVersion"
${If} "$0" != "${GREVersion}"
@ -67,7 +69,6 @@
; Add Software\Mozilla\ registry entries
${SetAppKeys}
${FixClassKeys}
${UpdateProtocolHandlers}
; Remove files that may be left behind by the application in the
; VirtualStore directory.
@ -108,7 +109,6 @@
${FixShellIconHandler}
WriteRegStr HKCU "Software\Clients\StartMenuInternet" "" "$R9"
!ifdef ___WINVER__NSH___
${If} ${AtLeastWinVista}
ClearErrors
ReadRegStr $0 HKLM "Software\RegisteredApplications" "${AppRegName}"
@ -118,7 +118,6 @@
AppAssocReg::SetAppAsDefaultAll "${AppRegName}"
${EndUnless}
${EndIf}
!endif
${RemoveDeprecatedKeys}
@ -157,11 +156,11 @@
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk"
Pop $0
${If} $0 == ""
${If} "$0" == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
Pop $0
; Needs to handle short paths
${If} $0 == "$INSTDIR\${FileMainEXE}"
${If} "$0" == "$INSTDIR\${FileMainEXE}"
Delete "$DESKTOP\${BrandFullName}.lnk"
${EndIf}
${EndIf}
@ -170,11 +169,11 @@
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
${If} $0 == ""
${If} "$0" == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $0
; Needs to handle short paths
${If} $0 == "$INSTDIR\${FileMainEXE}"
${If} "$0" == "$INSTDIR\${FileMainEXE}"
Delete "$QUICKLAUNCH\${BrandFullName}.lnk"
${EndIf}
${EndIf}
@ -227,7 +226,7 @@
WriteRegStr SHCTX "$0\.shtml" "" "FirefoxHTML"
${EndIf}
ReadRegStr $6 HKCR ".hht" ""
ReadRegStr $6 HKCR ".xht" ""
${If} "$6" != "FirefoxHTML"
WriteRegStr SHCTX "$0\.xht" "" "FirefoxHTML"
${EndIf}
@ -362,7 +361,7 @@
${If} ${FileExists} "$DESKTOP\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$DESKTOP\${BrandFullName}.lnk"
Pop $1
${If} $1 == ""
${If} "$1" == ""
ShellLink::GetShortCutTarget "$DESKTOP\${BrandFullName}.lnk"
Pop $1
${GetLongPath} "$1" $1
@ -376,7 +375,7 @@
; XXXrstrong - need a cleaner way to prevent unsetting SHCTX from HKLM when
; trying to find the desktop shortcut.
${If} $TmpVal == "HKCU"
${If} "$TmpVal" == "HKCU"
SetShellVarContext current ; Set SHCTX to the current user (e.g. HKCU)
${Else}
SetShellVarContext all ; Set SHCTX to all users (e.g. HKLM)
@ -385,11 +384,11 @@
${If} ${FileExists} "$QUICKLAUNCH\${BrandFullName}.lnk"
ShellLink::GetShortCutArgs "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $1
${If} $1 == ""
${If} "$1" == ""
ShellLink::GetShortCutTarget "$QUICKLAUNCH\${BrandFullName}.lnk"
Pop $1
${GetLongPath} "$1" $1
${If} $1 == "$8\${FileMainEXE}"
${If} "$1" == "$8\${FileMainEXE}"
${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 1 0
${Else}
${WriteRegDWORD2} $TmpVal "$0" "Create Quick Launch Shortcut" 0 0
@ -544,7 +543,7 @@
; Delete gopher from the user's UrlAssociations if it points to FirefoxURL.
StrCpy $0 "Software\Microsoft\Windows\Shell\Associations\UrlAssociations\gopher"
ReadRegStr $2 HKCU "$0\UserChoice" "Progid"
${If} $2 == "FirefoxURL"
${If} "$2" == "FirefoxURL"
DeleteRegKey HKCU "$0"
${EndIf}
!macroend

View File

@ -3093,6 +3093,7 @@
/**
* Checks if a handler's open command points to this installation directory.
* Uses SHCTX to determine the registry hive (e.g. HKLM or HKCU) to check.
*
* @param _HANDLER_NAME
* The registry name for the handler.
@ -3126,7 +3127,7 @@
StrCpy $R8 "$R9"
StrCpy $R9 "false"
ReadRegStr $R7 HKCR "$R8\shell\open\command" ""
ReadRegStr $R7 SHCTX "Software\Classes\$R8\shell\open\command" ""
StrCmp "$R7" "" end
${GetPathFromString} "$R7" $R7