Bug 1689791 - Port bug 1670147: Set AccessibleHandler CLSID/IIDs specific for Thunderbird at configure time. r=darktrojan
authorRob Lemley <rob@thunderbird.net>
Tue, 20 Jul 2021 02:02:37 +0000
changeset 43416 78ad8d7f2b8e1ebef857e2100963955f744f533d
parent 43415 0c50b8b1013f9399d0254c29c5451b932d6f9bf3
child 43417 7e01d4429355e3f32ab2016b300ad02f12d67c11
push id3235
push usertbbld-merge
push dateMon, 09 Aug 2021 21:11:24 +0000
treeherdercomm-beta@2f687affd357 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1689791, 1670147
Bug 1689791 - Port bug 1670147: Set AccessibleHandler CLSID/IIDs specific for Thunderbird at configure time. r=darktrojan Thunderbird needs to use unique UUIDs for AccessibleHandler to prevent clashing with Firefox. Local and non-shippable builds will use the GUIDs from confvars.sh. Daily, beta, and release builds use the GUIDs in branding/configure.sh. confvars.sh is evaluated before branding/configure.sh. Using the update channel to override the fallback GUIDs is not ideal, but should be sufficient. Differential Revision: https://phabricator.services.mozilla.com/D118181
mail/branding/nightly/configure.sh
mail/branding/thunderbird/configure.sh
mail/confvars.sh
mail/installer/windows/moz.build
mail/installer/windows/nsis/defines.nsi.in
--- a/mail/branding/nightly/configure.sh
+++ b/mail/branding/nightly/configure.sh
@@ -1,6 +1,15 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MOZ_APP_DISPLAYNAME="Thunderbird Daily"
 MOZ_MACBUNDLE_ID="thunderbird-daily"
+
+# Only shippable builds from comm-central will set the update channel to "nightly"
+if test "$MOZ_UPDATE_CHANNEL" = "nightly"; then
+  # Official nightly (shippable) builds
+  MOZ_HANDLER_CLSID="e5643070-8ec1-4978-8e6c-f0f1753e329e"
+  MOZ_IHANDLERCONTROL_IID="d1324f09-3446-404e-ae12-a3128ba8580e"
+  MOZ_ASYNCIHANDLERCONTROL_IID="15f84f27-8a4c-4bdf-ae0a-c0fea8fefe91"
+  MOZ_IGECKOBACKCHANNEL_IID="6ab50aef-8ad3-460f-9235-e4b72e7e2e7e"
+fi
--- a/mail/branding/thunderbird/configure.sh
+++ b/mail/branding/thunderbird/configure.sh
@@ -1,1 +1,20 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
 MOZ_APP_DISPLAYNAME=Thunderbird
+
+# Only shippable builds will set the update channels to "beta" and "release"
+if test "$MOZ_UPDATE_CHANNEL" = "beta"; then
+  # Official beta builds
+  MOZ_IHANDLERCONTROL_IID="5a6e864b-5c25-49b3-9e78-0d4cad17f866"
+  MOZ_ASYNCIHANDLERCONTROL_IID="5da761f6-9aca-4f2f-b22a-062ee46265b4"
+  MOZ_HANDLER_CLSID="fd54d983-72e8-48d7-96a0-5c23a47f772c"
+  MOZ_IGECKOBACKCHANNEL_IID="e14a4035-43b9-4751-8ad8-c3e74c088882"
+else
+  # Official release builds
+  MOZ_IHANDLERCONTROL_IID="127c0620-d3a7-45f1-8478-13d58249d68f"
+  MOZ_ASYNCIHANDLERCONTROL_IID="fe46dfa3-16b6-4780-93cc-4f6c174dc10d"
+  MOZ_HANDLER_CLSID="6e5ac413-1ef1-4985-87c2-f02e86e3ecdb"
+  MOZ_IGECKOBACKCHANNEL_IID="0a8c4e6c-903f-41a9-b5d0-3520db8f936b"
+fi
--- a/mail/confvars.sh
+++ b/mail/confvars.sh
@@ -14,16 +14,44 @@ fi
 
 BROWSER_CHROME_URL=chrome://messenger/content/extensionPopup.xhtml
 
 MOZ_BRANDING_DIRECTORY=$commreltopsrcdir/mail/branding/nightly
 MOZ_OFFICIAL_BRANDING_DIRECTORY=$commreltopsrcdir/mail/branding/thunderbird
 
 MOZ_APP_ID={3550f703-e582-4d05-9a08-453d09bdfdc6}
 
+# Windows AccessibleHandler.dll GUIDs differ depending on product, channel,
+# and officiality. This prevents handlers from installing overtop one another
+# when multiple products and channels are present.
+# These GUIDs are used for non-official and non-release builds.
+# GUIDs used for official shippable builds are in the branding directories.
+# This file is evaluated before the branding/configure.sh files.
+if test "$DEVELOPER_OPTIONS"; then
+  if test "$MOZ_DEBUG"; then
+    # Local debug builds
+    MOZ_HANDLER_CLSID="276382b8-078f-4a75-b95f-ebcc41b4e561"
+    MOZ_IHANDLERCONTROL_IID="55960b36-86ff-4b46-90eb-11e66a8251a0"
+    MOZ_ASYNCIHANDLERCONTROL_IID="78b9a700-787e-406a-b94a-e656a2d4595f"
+    MOZ_IGECKOBACKCHANNEL_IID="68966673-f742-4f1d-8f1c-d0517f282d8a"
+  else
+    # Local non-debug builds
+    MOZ_HANDLER_CLSID="54b33546-ee72-4ab7-8710-200c4ec74742"
+    MOZ_IHANDLERCONTROL_IID="6ee6f1c5-d331-4fa2-8e95-b9680a0f0264"
+    MOZ_ASYNCIHANDLERCONTROL_IID="3da29f8e-d8ee-4d60-80f8-74665b7f271c"
+    MOZ_IGECKOBACKCHANNEL_IID="0195ae7b-1315-442f-a0b8-d94372d51917"
+  fi
+else
+  # These are fallback GUIDs
+  MOZ_HANDLER_CLSID="a1a19c81-bc15-41fc-871e-d156bc600ea7"
+  MOZ_IHANDLERCONTROL_IID="458bec8f-de60-4c44-ba08-29d47412feb8"
+  MOZ_ASYNCIHANDLERCONTROL_IID="9deb1d0b-766d-47ed-a912-22602ccb4e22"
+  MOZ_IGECKOBACKCHANNEL_IID="623aa5c7-eb2c-4807-b5dd-f3e3754de30f"
+fi
+
 MOZ_PROFILE_MIGRATOR=1
 MOZ_BINARY_EXTENSIONS=1
 MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES=1
 
 # Enable building ./signmar and running libmar signature tests
 MOZ_ENABLE_SIGNMAR=1
 
 MOZ_DEVTOOLS=all
--- a/mail/installer/windows/moz.build
+++ b/mail/installer/windows/moz.build
@@ -5,8 +5,10 @@
 
 DEFINES["APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
 
 DEFINES["MOZ_APP_NAME"] = CONFIG["MOZ_APP_NAME"]
 DEFINES["MOZ_APP_DISPLAYNAME"] = CONFIG["MOZ_APP_DISPLAYNAME"]
 DEFINES["MOZILLA_VERSION"] = CONFIG["MOZILLA_VERSION"]
 DEFINES["MOZ_APP_VERSION"] = CONFIG["MOZ_APP_VERSION"]
 DEFINES["PRE_RELEASE_SUFFIX"] = ""
+
+DEFINES["MOZ_HANDLER_CLSID"] = "{%s}" % CONFIG["MOZ_HANDLER_CLSID"]
--- a/mail/installer/windows/nsis/defines.nsi.in
+++ b/mail/installer/windows/nsis/defines.nsi.in
@@ -42,31 +42,17 @@
 !if "@PRE_RELEASE_SUFFIX@" != ""
 !define NO_INSTDIR_FROM_REG
 !endif
 
 # AccessibleHandler.dll uses a different CLSID depending on release channel.
 # These defines must match HANDLER_CLSID defined in
 # accessible/ipc/win/handler/HandlerData.idl
 
-!if "@MOZ_UPDATE_CHANNEL@" == "default"
-#ifdef DEBUG
-!define AccessibleHandlerCLSID "{398FFD8D-5382-48F7-9E3B-19012762D39A}"
-#else
-!define AccessibleHandlerCLSID "{CE573FAF-7815-4FC2-A031-B092268ACE9E}"
-#endif
-!else if "@MOZ_UPDATE_CHANNEL@" == "nightly"
-!define AccessibleHandlerCLSID "{4629216B-8753-41BF-9527-5BFF51401671}"
-!else if "@MOZ_UPDATE_CHANNEL@" == "beta"
-!define AccessibleHandlerCLSID "{21E9F98D-A6C9-4CB5-B288-AE2FD2A96C58}"
-!else if "@MOZ_UPDATE_CHANNEL@" == "release"
-!define AccessibleHandlerCLSID "{1BAA303D-B4B9-45E5-9CCB-E3FCA3E274B6}"
-!else
-!define AccessibleHandlerCLSID "{4A195748-DCA2-45FB-9295-0A139E76A9E7}"
-!endif
+!define AccessibleHandlerCLSID "@MOZ_HANDLER_CLSID@"
 
 # ARCH is used when it is necessary to differentiate the x64 registry keys from
 # the x86 registry keys (e.g. the uninstall registry key).
 #ifdef HAVE_64BIT_BUILD
 !define HAVE_64BIT_BUILD
 #ifdef _ARM64_
 !define ARCH "AArch64"
 !define MinSupportedVer "Microsoft Windows 10 for ARM"