mirror of
https://github.com/element-hq/element-desktop
synced 2025-04-02 04:13:41 +02:00
Iterate
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
c5a1d95e83
commit
357ec2033c
2
.github/workflows/build_and_test.yaml
vendored
2
.github/workflows/build_and_test.yaml
vendored
@ -22,7 +22,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/build_windows.yaml
|
uses: ./.github/workflows/build_windows.yaml
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
arch: [x64]
|
arch: [x64, ia32, arm64]
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
diff --git a/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js b/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
diff --git a/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js b/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
||||||
index 15312f4..06ac3d0 100644
|
index 15312f4..7695162 100644
|
||||||
--- a/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
--- a/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
||||||
+++ b/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
+++ b/node_modules/electron-builder-squirrel-windows/out/SquirrelWindowsTarget.js
|
||||||
@@ -1,11 +1,10 @@
|
@@ -1,11 +1,11 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const builder_util_1 = require("builder-util");
|
const builder_util_1 = require("builder-util");
|
||||||
@ -12,10 +12,11 @@ index 15312f4..06ac3d0 100644
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
-const promises_1 = require("fs/promises");
|
-const promises_1 = require("fs/promises");
|
||||||
|
+const os = require("os");
|
||||||
const electron_winstaller_1 = require("electron-winstaller");
|
const electron_winstaller_1 = require("electron-winstaller");
|
||||||
class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
||||||
constructor(packager, outDir) {
|
constructor(packager, outDir) {
|
||||||
@@ -14,8 +13,28 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
@@ -14,8 +14,28 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
||||||
this.outDir = outDir;
|
this.outDir = outDir;
|
||||||
//tslint:disable-next-line:no-object-literal-type-assertion
|
//tslint:disable-next-line:no-object-literal-type-assertion
|
||||||
this.options = { ...this.packager.platformSpecificBuildOptions, ...this.packager.config.squirrelWindows };
|
this.options = { ...this.packager.platformSpecificBuildOptions, ...this.packager.config.squirrelWindows };
|
||||||
@ -46,7 +47,7 @@ index 15312f4..06ac3d0 100644
|
|||||||
}
|
}
|
||||||
async build(appOutDir, arch) {
|
async build(appOutDir, arch) {
|
||||||
const packager = this.packager;
|
const packager = this.packager;
|
||||||
@@ -24,28 +43,35 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
@@ -24,28 +44,35 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
||||||
const setupFile = packager.expandArtifactNamePattern(this.options, "exe", arch, "${productName} Setup ${version}.${ext}");
|
const setupFile = packager.expandArtifactNamePattern(this.options, "exe", arch, "${productName} Setup ${version}.${ext}");
|
||||||
const installerOutDir = path.join(this.outDir, `squirrel-windows${(0, app_builder_lib_1.getArchSuffix)(arch)}`);
|
const installerOutDir = path.join(this.outDir, `squirrel-windows${(0, app_builder_lib_1.getArchSuffix)(arch)}`);
|
||||||
const artifactPath = path.join(installerOutDir, setupFile);
|
const artifactPath = path.join(installerOutDir, setupFile);
|
||||||
@ -92,16 +93,20 @@ index 15312f4..06ac3d0 100644
|
|||||||
const packagePrefix = `${this.appName}-${(0, electron_winstaller_1.convertVersion)(version)}-`;
|
const packagePrefix = `${this.appName}-${(0, electron_winstaller_1.convertVersion)(version)}-`;
|
||||||
packager.info.dispatchArtifactCreated({
|
packager.info.dispatchArtifactCreated({
|
||||||
file: path.join(installerOutDir, `${packagePrefix}full.nupkg`),
|
file: path.join(installerOutDir, `${packagePrefix}full.nupkg`),
|
||||||
@@ -73,11 +99,24 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
@@ -71,13 +98,28 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
||||||
|
get appName() {
|
||||||
|
return this.options.name || this.packager.appInfo.name;
|
||||||
}
|
}
|
||||||
select7zipArch(vendorDirectory, arch) {
|
- select7zipArch(vendorDirectory, arch) {
|
||||||
// Copy the 7-Zip executable for the configured architecture.
|
- // Copy the 7-Zip executable for the configured architecture.
|
||||||
- const resolvedArch = (0, app_builder_lib_1.getArchSuffix)(arch) === "" ? process.arch : (0, app_builder_lib_1.getArchSuffix)(arch);
|
- const resolvedArch = (0, app_builder_lib_1.getArchSuffix)(arch) === "" ? process.arch : (0, app_builder_lib_1.getArchSuffix)(arch);
|
||||||
- fs.copyFileSync(path.join(vendorDirectory, `7z-${resolvedArch}.exe`), path.join(vendorDirectory, "7z.exe"));
|
+ select7zipArch(vendorDirectory) {
|
||||||
- fs.copyFileSync(path.join(vendorDirectory, `7z-${resolvedArch}.dll`), path.join(vendorDirectory, "7z.dll"));
|
+ // https://github.com/electron/windows-installer/blob/main/script/select-7z-arch.js
|
||||||
+ const resolvedArch = (0, app_builder_lib_1.getArchSuffix)(arch) || `-${process.arch}`;
|
+ // Even if we're cross-compiling for a different arch like arm64,
|
||||||
+ fs.copyFileSync(path.join(vendorDirectory, `7z${resolvedArch}.exe`), path.join(vendorDirectory, "7z.exe"));
|
+ // we still need to use the 7-Zip executable for the host arch
|
||||||
+ fs.copyFileSync(path.join(vendorDirectory, `7z${resolvedArch}.dll`), path.join(vendorDirectory, "7z.dll"));
|
+ const resolvedArch = os.arch;
|
||||||
|
fs.copyFileSync(path.join(vendorDirectory, `7z-${resolvedArch}.exe`), path.join(vendorDirectory, "7z.exe"));
|
||||||
|
fs.copyFileSync(path.join(vendorDirectory, `7z-${resolvedArch}.dll`), path.join(vendorDirectory, "7z.dll"));
|
||||||
}
|
}
|
||||||
- async computeEffectiveDistOptions() {
|
- async computeEffectiveDistOptions() {
|
||||||
+ async createNuspecTemplateWithProjectUrl() {
|
+ async createNuspecTemplateWithProjectUrl() {
|
||||||
@ -121,7 +126,7 @@ index 15312f4..06ac3d0 100644
|
|||||||
const packager = this.packager;
|
const packager = this.packager;
|
||||||
let iconUrl = this.options.iconUrl;
|
let iconUrl = this.options.iconUrl;
|
||||||
if (iconUrl == null) {
|
if (iconUrl == null) {
|
||||||
@@ -91,42 +130,27 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
@@ -91,42 +133,27 @@ class SquirrelWindowsTarget extends app_builder_lib_1.Target {
|
||||||
}
|
}
|
||||||
checkConflictingOptions(this.options);
|
checkConflictingOptions(this.options);
|
||||||
const appInfo = packager.appInfo;
|
const appInfo = packager.appInfo;
|
||||||
@ -168,7 +173,7 @@ index 15312f4..06ac3d0 100644
|
|||||||
- },
|
- },
|
||||||
- };
|
- };
|
||||||
+ options.vendorDirectory = await this.prepareSignedVendorDirectory();
|
+ options.vendorDirectory = await this.prepareSignedVendorDirectory();
|
||||||
+ this.select7zipArch(options.vendorDirectory, arch);
|
+ this.select7zipArch(options.vendorDirectory);
|
||||||
+ options.fixUpPaths = true;
|
+ options.fixUpPaths = true;
|
||||||
+ options.setupExe = setupFile;
|
+ options.setupExe = setupFile;
|
||||||
+ if (this.options.msi) {
|
+ if (this.options.msi) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user