From c5e3a475fc8cc15ba247977d09fae1a16615c003 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sun, 15 Oct 2023 18:20:05 -0500 Subject: [PATCH] Update Electron to 22.3.27 and add ARM support (#768) --- electron-bin/generate-windows.js | 5 ++-- electron-bin/version.json | 2 +- src/locales/en.json | 12 ++++++++++ src/p4/PackagerOptions.svelte | 24 +++++++++++++++----- src/packager/large-assets.js | 39 ++++++++++++++++++++++---------- 5 files changed, 61 insertions(+), 21 deletions(-) diff --git a/electron-bin/generate-windows.js b/electron-bin/generate-windows.js index 2fe9b97..d02a490 100644 --- a/electron-bin/generate-windows.js +++ b/electron-bin/generate-windows.js @@ -10,7 +10,7 @@ const crypto = require('crypto'); const {electronVersion} = require('./version.json'); -const newIconPath = path.join(__dirname, '..', 'src', 'packager', 'images', 'default-icon.ico'); +const newIconPath = path.join(__dirname, '../src/packager/images/default-icon.ico'); const download = (arch) => downloadArtifact({ version: electronVersion, @@ -19,7 +19,7 @@ const download = (arch) => downloadArtifact({ arch }); -const getTempFile = (name) => path.join(__dirname, 'temp', 'windows', name); +const getTempFile = (name) => path.join(__dirname, 'temp/windows', name); const extract = async (from, name) => { const to = getTempFile(name); @@ -74,6 +74,7 @@ const run = async (arch) => { run('ia32') .then(() => run('x64')) + .then(() => run('arm64')) .catch((err) => { console.error(err); process.exit(1); diff --git a/electron-bin/version.json b/electron-bin/version.json index 3267114..13f6bb6 100644 --- a/electron-bin/version.json +++ b/electron-bin/version.json @@ -1,3 +1,3 @@ { - "electronVersion": "21.2.3" + "electronVersion": "22.3.27" } \ No newline at end of file diff --git a/src/locales/en.json b/src/locales/en.json index 034cb01..c86426a 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -464,6 +464,10 @@ "string": "{type} Windows application (64-bit only, not recommended)", "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Windows'." }, + "application-win-arm": { + "string": "{type} Windows application for ARM", + "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Windows' or 'ARM'." + }, "application-mac": { "string": "{type} macOS application", "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'macOS'." @@ -472,6 +476,14 @@ "string": "{type} Linux application (64-bit only)", "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Linux'." }, + "application-linux-arm32": { + "string": "{type} Linux application for ARM (32-bit)", + "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Linux' or 'ARM'." + }, + "application-linux-arm64": { + "string": "{type} Linux application for ARM (64-bit)", + "context": "type will become something like 'NW.js' or 'Electron'. Do not translate 'Linux' or 'ARM'." + }, "otherEnvironments": { "string": "Other environments (Click to open)", "context": "Text that can be clicked to expand list of environments to include some unrecommended ones." diff --git a/src/p4/PackagerOptions.svelte b/src/p4/PackagerOptions.svelte index e1c139e..1281f97 100644 --- a/src/p4/PackagerOptions.svelte +++ b/src/p4/PackagerOptions.svelte @@ -832,11 +832,24 @@ {$_('options.application-win64').replace('{type}', 'Electron')} + + + +
{:else if $options.target.includes('nwjs')}
diff --git a/src/packager/large-assets.js b/src/packager/large-assets.js index 94f671c..129811d 100644 --- a/src/packager/large-assets.js +++ b/src/packager/large-assets.js @@ -42,24 +42,39 @@ export default { estimatedSize: 135854818 }, 'electron-win32': { - src: externalFile('electron-v21.2.3-win32-ia32.zip'), - sha256: 'ee813a8dc4050c7d3a3cc80233bf5f4ddd0483e1c934eb69d735a3b3563ce3bf', - estimatedSize: 89317110 + src: externalFile('electron-v22.3.27-win32-ia32.zip'), + sha256: '47bd498e5513529c5e141394fc9fd610cba1dcdea9e6dbb165edf929cbfd9af2', + estimatedSize: 90856612 }, 'electron-win64': { - src: externalFile('electron-v21.2.3-win32-x64.zip'), - sha256: 'b1695f0528567ecc1f7e667520c7770321df35d058841e24c4e9793f4e43e56a', - estimatedSize: 95073928 + src: externalFile('electron-v22.3.27-win32-x64.zip'), + sha256: '1a02c0f7af9664696f790dcce05948f0458a2f4f2d48c685f911d2eb99a4c9da', + estimatedSize: 96605498 + }, + 'electron-win-arm': { + src: externalFile('electron-v22.3.27-win32-arm64.zip'), + sha256: '0e4ad218018c0881ef4de363107a94dd2ced40367a0e18ca7d0dde1f40da0531', + estimatedSize: 94065344 }, 'electron-mac': { - src: externalFile('electron-v21.0.1-macos-universal.zip'), - sha256: 'c31d1ef26f7b6230881a11308ebf8f4487a1a3fb7a151da0972fad77bc9e6acf', - estimatedSize: 154789837 + src: externalFile('electron-v22.3.27-macos-universal.zip'), + sha256: '598b35f9030fe30f81b4041be048cd0374f675bd1bc0f172c26cf2808e80a3d9', + estimatedSize: 160882083 }, 'electron-linux64': { - src: externalFile('electron-v21.0.1-linux-x64.zip'), - sha256: '4fd6d7b5a65f44a43165ae77d0484db992b30d6efba478a192e984506fbd52b6', - estimatedSize: 90635371 + src: externalFile('electron-v22.3.27-linux-x64.zip'), + sha256: '631d8eb08098c48ce2b29421e74c69ac0312b1e42f445d8a805414ba1242bf3a', + estimatedSize: 93426892 + }, + 'electron-linux-arm32': { + src: externalFile('electron-v22.3.27-linux-armv7l.zip'), + sha256: '9f8372606e5ede83cf1c73a3d8ff07047e4e3ef614aa89a76cd497dc06cf119d', + estimatedSize: 82722572 + }, + 'electron-linux-arm64': { + src: externalFile('electron-v22.3.27-linux-arm64.zip'), + sha256: '60279395a5ce4eaf3c08f1e717771b203830902d3fe3a7c311bc37deb1a0e15e', + estimatedSize: 93932512 }, 'webview-mac': { src: externalFile('WebView-macos-5.zip'),