From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- browser/installer/windows/nsis/installer.nsi | 19 ++++++--- browser/installer/windows/nsis/shared.nsh | 47 +++++++++++++++++++++ browser/installer/windows/nsis/uninstaller.nsi | 57 +++----------------------- 3 files changed, 67 insertions(+), 56 deletions(-) (limited to 'browser/installer/windows/nsis') diff --git a/browser/installer/windows/nsis/installer.nsi b/browser/installer/windows/nsis/installer.nsi index 7ec5f9fe6f..c282067697 100755 --- a/browser/installer/windows/nsis/installer.nsi +++ b/browser/installer/windows/nsis/installer.nsi @@ -474,22 +474,22 @@ Section "-Application" APP_IDX ${AddDisabledDDEHandlerValues} "FirefoxURL-$AppUserModelID" "$2" "$8,${IDI_DOCUMENT_ZERO_BASED}" \ "${AppRegName} URL" "true" - ; Create protocol registry keys for dual browser extensions - only if not already set + ; Create protocol registry keys for FirefoxBridge extensions - only if not already set SetShellVarContext current ; Set SHCTX to HKCU - !define FIREFOX_PROTOCOL "firefox" + !define FIREFOX_PROTOCOL "firefox-bridge" ClearErrors ReadRegStr $0 SHCTX "Software\Classes\${FIREFOX_PROTOCOL}" "" ${If} $0 == "" ${AddDisabledDDEHandlerValues} "${FIREFOX_PROTOCOL}" "$2" "$8,${IDI_APPICON_ZERO_BASED}" \ - "Firefox Browsing Protocol" "true" + "Firefox Bridge Protocol" "true" ${EndIf} - !define FIREFOX_PRIVATE_PROTOCOL "firefox-private" + !define FIREFOX_PRIVATE_PROTOCOL "firefox-private-bridge" ClearErrors ReadRegStr $0 SHCTX "Software\Classes\${FIREFOX_PRIVATE_PROTOCOL}" "" ${If} $0 == "" ${AddDisabledDDEHandlerValues} "${FIREFOX_PRIVATE_PROTOCOL}" "$\"$8$\" -osint -private-window $\"%1$\"" \ - "$8,${IDI_PBICON_PB_EXE_ZERO_BASED}" "Firefox Private Browsing Protocol" "true" + "$8,${IDI_PBICON_PB_EXE_ZERO_BASED}" "Firefox Private Bridge Protocol" "true" ${EndIf} SetShellVarContext all ; Set SHCTX to HKLM @@ -794,6 +794,15 @@ Section "-InstallEndCleanup" ; Refresh desktop icons ${RefreshShellIcons} + ; Remove old unsupported firefox and firefox-private extension protocol + ; handlers which were added in FX122 for the dual browser extension, since + ; renamed to FirefoxBridge + Push $1 + ${GetLongPath} "$INSTDIR\${FileMainEXE}" $1 + ${DeleteProtocolRegistryIfSetToInstallation} "$1" "firefox" + ${DeleteProtocolRegistryIfSetToInstallation} "$1" "firefox-private" + Pop $1 + ${InstallEndCleanupCommon} ${If} $PreventRebootRequired == "true" diff --git a/browser/installer/windows/nsis/shared.nsh b/browser/installer/windows/nsis/shared.nsh index f0caece663..ccad601abe 100755 --- a/browser/installer/windows/nsis/shared.nsh +++ b/browser/installer/windows/nsis/shared.nsh @@ -1577,6 +1577,7 @@ ${RemoveDefaultBrowserAgentShortcut} Push "crashreporter.exe" Push "default-browser-agent.exe" Push "minidump-analyzer.exe" + Push "nmhproxy.exe" Push "pingsender.exe" Push "updater.exe" Push "mozwer.dll" @@ -1824,3 +1825,49 @@ FunctionEnd ${WriteRegStr2} ${RegKey} "Software\Classes\CLSID\$0\InProcServer32" "" "$INSTDIR\notificationserver.dll" 0 !macroend !define WriteToastNotificationRegistration "!insertmacro WriteToastNotificationRegistration" + +/** + * Deletes the registry keys for a protocol handler but only if those registry + * keys were pointed to the installation being uninstalled. + * Does this with both the HKLM and the HKCU registry entries. + * + * @param _PROTOCOL + * The protocol to delete the registry keys for + */ +!macro DeleteProtocolRegistryIfSetToInstallation INSTALL_PATH _PROTOCOL + Push $0 + + ; Check if there is a protocol handler registered by fetching the DefaultIcon value + ; in the registry. + ; If there is something registered for the icon, it will be the path to the executable, + ; plus a comma and a number for the id of the resource for the icon. + ; Use StrCpy with -2 to remove the comma and the resource id so that + ; the whole path to the executable can be compared against what's being + ; uninstalled. + + ; Do all of that twice, once for the local machine and once for the current user + + ; Remove protocol handlers + ClearErrors + ReadRegStr $0 HKLM "Software\Classes\${_PROTOCOL}\DefaultIcon" "" + ${If} $0 != "" + StrCpy $0 $0 -2 + ${If} $0 == '"${INSTALL_PATH}"' + DeleteRegKey HKLM "Software\Classes\${_PROTOCOL}" + ${EndIf} + ${EndIf} + + ClearErrors + ReadRegStr $0 HKCU "Software\Classes\${_PROTOCOL}\DefaultIcon" "" + ${If} $0 != "" + StrCpy $0 $0 -2 + ${If} $0 == '"${INSTALL_PATH}"' + DeleteRegKey HKCU "Software\Classes\${_PROTOCOL}" + ${EndIf} + ${EndIf} + + ClearErrors + + Pop $0 +!macroend +!define DeleteProtocolRegistryIfSetToInstallation '!insertmacro DeleteProtocolRegistryIfSetToInstallation' diff --git a/browser/installer/windows/nsis/uninstaller.nsi b/browser/installer/windows/nsis/uninstaller.nsi index 695beed25f..31bd992047 100755 --- a/browser/installer/windows/nsis/uninstaller.nsi +++ b/browser/installer/windows/nsis/uninstaller.nsi @@ -411,54 +411,6 @@ SectionEnd ################################################################################ # Uninstall Sections -/** - * Deletes the registry keys for a protocol handler but only if those registry - * keys were pointed to the installation being uninstalled. - * Does this with both the HKLM and the HKCU registry entries. - * - * @param _PROTOCOL - * The protocol to delete the registry keys for - */ -!macro DeleteProtocolRegistryIfSetToInstallation _PROTOCOL - Push $0 - Push $1 - ; Check if there is a protocol handler registered by fetching the DefaultIcon value - ; in the registry. - ; If there is something registered for the icon, it will be the path to the executable, - ; plus a comma and a number for the id of the resource for the icon. - ; Use StrCpy with -2 to remove the comma and the resource id so that - ; the whole path to the executable can be compared against what's being - ; uninstalled. - - ; Do all of that twice, once for the local machine and once for the current user - - ; Remove protocol handlers - ClearErrors - ${un.GetLongPath} "$INSTDIR\${FileMainEXE}" $1 - ReadRegStr $0 HKLM "Software\Classes\${_PROTOCOL}\DefaultIcon" "" - ${If} $0 != "" - StrCpy $0 $0 -2 - ${If} $0 == $1 - DeleteRegKey HKLM "Software\Classes\${_PROTOCOL}" - ${EndIf} - ${EndIf} - - ClearErrors - ReadRegStr $0 HKCU "Software\Classes\${_PROTOCOL}\DefaultIcon" "" - ${If} $0 != "" - StrCpy $0 $0 -2 - ${If} $0 == $1 - DeleteRegKey HKCU "Software\Classes\${_PROTOCOL}" - ${EndIf} - ${EndIf} - - ClearErrors - - Pop $0 - Pop $1 -!macroend -!define DeleteProtocolRegistryIfSetToInstallation '!insertmacro DeleteProtocolRegistryIfSetToInstallation' - Section "Uninstall" SetDetailsPrint textonly DetailPrint $(STATUS_UNINSTALL_MAIN) @@ -571,9 +523,12 @@ Section "Uninstall" ; Clean up "launch on login" registry key for this installation. DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "Mozilla-${AppName}-$AppUserModelID" - ; Remove dual browser extension protocol handlers - ${DeleteProtocolRegistryIfSetToInstallation} "firefox" - ${DeleteProtocolRegistryIfSetToInstallation} "firefox-private" + ; Remove FirefoxBridge extension protocol handlers + Push $1 + ${un.GetLongPath} "$INSTDIR\${FileMainEXE}" $1 + ${DeleteProtocolRegistryIfSetToInstallation} "$1" "firefox-bridge" + ${DeleteProtocolRegistryIfSetToInstallation} "$1" "firefox-private-bridge" + Pop $1 ; Remove old protocol handler and StartMenuInternet keys without install path ; hashes, but only if they're for this installation. We've never supported -- cgit v1.2.3