diff --git a/browser/installer/windows/msix/AppxManifest.xml.in b/browser/installer/windows/msix/AppxManifest.xml.in index 845db766f4d9..74b14226189d 100644 --- a/browser/installer/windows/msix/AppxManifest.xml.in +++ b/browser/installer/windows/msix/AppxManifest.xml.in @@ -85,6 +85,20 @@ Assets\Document44x44.png + + + + + + + + + + + diff --git a/python/mozbuild/mozbuild/repackaging/msix.py b/python/mozbuild/mozbuild/repackaging/msix.py index 1baa06455157..b6b279c13549 100644 --- a/python/mozbuild/mozbuild/repackaging/msix.py +++ b/python/mozbuild/mozbuild/repackaging/msix.py @@ -631,6 +631,8 @@ def repackage_msix( "APPX_VERSION": version, "MOZ_APP_DISPLAYNAME": displayname, "MOZ_APP_NAME": app_name, + # Keep synchronized with `toolkit\mozapps\notificationserver\NotificationComServer.cpp`. + "MOZ_INOTIFICATIONACTIVATION_CLSID": "916f9b5d-b5b2-4d36-b047-03c7a52f81c8", } defines.update(brandingUuids) diff --git a/toolkit/mozapps/notificationserver/NotificationComServer.cpp b/toolkit/mozapps/notificationserver/NotificationComServer.cpp index 35a8aa46d31a..184b55be44cc 100644 --- a/toolkit/mozapps/notificationserver/NotificationComServer.cpp +++ b/toolkit/mozapps/notificationserver/NotificationComServer.cpp @@ -7,6 +7,8 @@ #include #include +#include "mozilla/WinHeaderOnlyUtils.h" + #include "NotificationFactory.h" using namespace std::filesystem; @@ -41,10 +43,23 @@ bool PopulateDllPath(HINSTANCE dllInstance) { // requested we verify the CLSID's InprocServer registry entry matches this // DLL's path. bool CheckRuntimeClsid(REFCLSID rclsid) { + // MSIX Notification COM Server registration is isolated to the package and is + // identical across installs/channels. + if (mozilla::HasPackageIdentity()) { + // Keep synchronized with `python\mozbuild\mozbuild\repackaging\msix.py`. + constexpr CLSID MOZ_INOTIFICATIONACTIVATION_CLSID = { + 0x916f9b5d, + 0xb5b2, + 0x4d36, + {0xb0, 0x47, 0x03, 0xc7, 0xa5, 0x2f, 0x81, 0xc8}}; + + return IsEqualCLSID(rclsid, MOZ_INOTIFICATIONACTIVATION_CLSID); + } + std::wstring clsid_str; { wchar_t* raw_clsid_str; - if (StringFromCLSID(rclsid, &raw_clsid_str) == S_OK) { + if (SUCCEEDED(StringFromCLSID(rclsid, &raw_clsid_str))) { clsid_str += raw_clsid_str; CoTaskMemFree(raw_clsid_str); } else {