From cbc18696588666007ec3680a9c975a102ad2fd0f Mon Sep 17 00:00:00 2001 From: Quang Lam Date: Fri, 25 Dec 2020 11:38:41 +0700 Subject: [PATCH] Fix win32 arm64 update info file overwrites x64 file --- patches/app-builder-lib+22.10.3.patch | 13 +++++++++++++ patches/electron-updater+4.3.7.patch | 18 ++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 patches/electron-updater+4.3.7.patch diff --git a/patches/app-builder-lib+22.10.3.patch b/patches/app-builder-lib+22.10.3.patch index 59a3b7369..208114a61 100644 --- a/patches/app-builder-lib+22.10.3.patch +++ b/patches/app-builder-lib+22.10.3.patch @@ -1,3 +1,16 @@ +diff --git a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js b/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js +index 180d84a..0e9925a 100644 +--- a/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js ++++ b/node_modules/app-builder-lib/out/publish/updateInfoBuilder.js +@@ -147,7 +147,7 @@ function getUpdateInfoFileName(channel, packager, arch) { + } + + function getArchPrefixForUpdateFile(arch, packager) { +- if (arch == null || arch === _builderUtil().Arch.x64 || packager.platform !== _core().Platform.LINUX) { ++ if (arch == null || arch === _builderUtil().Arch.x64 || packager.platform === _core().Platform.MAC) { + return ""; + } + diff --git a/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh b/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh index 886bebc..80fef38 100644 --- a/node_modules/app-builder-lib/templates/nsis/include/extractAppPackage.nsh diff --git a/patches/electron-updater+4.3.7.patch b/patches/electron-updater+4.3.7.patch new file mode 100644 index 000000000..1079cb6e8 --- /dev/null +++ b/patches/electron-updater+4.3.7.patch @@ -0,0 +1,18 @@ +diff --git a/node_modules/electron-updater/out/providers/Provider.js b/node_modules/electron-updater/out/providers/Provider.js +index f174c7b..b0cae4f 100644 +--- a/node_modules/electron-updater/out/providers/Provider.js ++++ b/node_modules/electron-updater/out/providers/Provider.js +@@ -55,8 +55,12 @@ class Provider { + const arch = process.env.TEST_UPDATER_ARCH || process.arch; + const archSuffix = arch === "x64" ? "" : `-${arch}`; + return "-linux" + archSuffix; ++ } else if (this.runtimeOptions.platform === "darwin") { ++ return "-mac"; + } else { +- return this.runtimeOptions.platform === "darwin" ? "-mac" : ""; ++ // win32 ++ const arch = process.env.TEST_UPDATER_ARCH || process.arch; ++ return arch === "x64" ? "" : `-${arch}`; + } + } // due to historical reasons for windows we use channel name without platform specifier +