Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: fix Windows MSIX release build errors (#49613)
* fix: fix MSIX release build

* fix: add C++/WinRT headers

* build: modify include paths

* fix: compile msix as seperate source set

* build: add additional needed deps for msix
  • Loading branch information
VerteDinde committed Feb 2, 2026
commit 4c2444a8bcbb369bba0b2cbfc9a2b9486b22be23
32 changes: 32 additions & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,37 @@ action("electron_generate_node_defines") {
args = [ rebase_path(target_gen_dir) ] + rebase_path(inputs)
}

# MSIX updater needs to be in a separate source_set because it uses C++/WinRT
# headers that require exceptions to be enabled.
source_set("electron_msix_updater") {
sources = [
"shell/browser/api/electron_api_msix_updater.cc",
"shell/browser/api/electron_api_msix_updater.h",
]

configs += [ "//third_party/electron_node:node_external_config" ]

public_configs = [ ":electron_lib_config" ]

if (is_win) {
cflags_cc = [
"/EHsc", # Enable C++ exceptions for C++/WinRT
"-Wno-c++98-compat-extra-semi", #Suppress C++98 compatibility warnings
]

include_dirs = [ "//third_party/nearby/src/internal/platform/implementation/windows/generated" ]
}

deps = [
"//base",
"//content/public/browser",
"//gin",
"//third_party/electron_node/deps/simdjson",
"//third_party/electron_node/deps/uv",
"//v8",
]
}

source_set("electron_lib") {
configs += [
"//v8:external_startup_data",
Expand All @@ -435,6 +466,7 @@ source_set("electron_lib") {
":electron_fuses",
":electron_generate_node_defines",
":electron_js2c",
":electron_msix_updater",
":electron_version_header",
":resources",
"buildflags",
Expand Down
2 changes: 0 additions & 2 deletions filenames.gni
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,6 @@ filenames = {
"shell/browser/api/electron_api_in_app_purchase.h",
"shell/browser/api/electron_api_menu.cc",
"shell/browser/api/electron_api_menu.h",
"shell/browser/api/electron_api_msix_updater.cc",
"shell/browser/api/electron_api_msix_updater.h",
"shell/browser/api/electron_api_native_theme.cc",
"shell/browser/api/electron_api_native_theme.h",
"shell/browser/api/electron_api_net_log.cc",
Expand Down
15 changes: 8 additions & 7 deletions shell/browser/api/electron_api_msix_updater.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@
#include <windows.foundation.metadata.h>
#include <windows.h>
#include <windows.management.deployment.h>
#include <winrt/base.h>
#include <winrt/windows.applicationmodel.core.h>
#include <winrt/windows.applicationmodel.h>
#include <winrt/windows.foundation.collections.h>
#include <winrt/windows.foundation.h>
#include <winrt/windows.foundation.metadata.h>
#include <winrt/windows.management.deployment.h>
// Use pre-generated C++/WinRT headers from //third_party/nearby instead of the
// SDK's cppwinrt headers, which are missing implementation files.
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.ApplicationModel.h"
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.Collections.h"
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.Metadata.h"
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Foundation.h"
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/Windows.Management.Deployment.h"
#include "third_party/nearby/src/internal/platform/implementation/windows/generated/winrt/base.h"

#include "base/win/scoped_com_initializer.h"
#endif
Expand Down
Loading