From 752c8363bfa3040bee2dbfe2484fd7b7409b2a5e Mon Sep 17 00:00:00 2001 From: salman Date: Tue, 20 Oct 2026 11:56:25 +0200 Subject: [PATCH] Document the win64/WoW64 Wine prefix needed to cross-build the .exe electron-winstaller's Squirrel runs as 32-bit .NET but zips the package by ShellExecuteEx-ing the 64-bit vendor/7z.exe. A 32-bit-only Wine prefix ('#arch=win32') cannot launch a 64-bit PE, so the cross-build fails with 'ShellExecuteEx failed: Bad EXE format'. Record the WINEARCH=win64 recipe (and the pre-existing Wine+Mono requirement) instead of leaving it as a build-host surprise. --- packaging/wsl2/README.md | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/packaging/wsl2/README.md b/packaging/wsl2/README.md index 479ab73..5a68687 100644 --- a/packaging/wsl2/README.md +++ b/packaging/wsl2/README.md @@ -97,6 +97,22 @@ The installer is written to `out/make/squirrel.windows/x64/` as `You must install both Mono and Wine on non-Windows`. Install e.g. `wine` and `mono-complete` (or `mono-core`) first. + It also needs a **64-bit (WoW64) Wine prefix**. Squirrel is a 32-bit .NET + assembly but zips the package by `ShellExecuteEx`-ing the 64-bit + `node_modules/electron-winstaller/vendor/7z.exe`; a 32-bit-only prefix + (`#arch=win32`) cannot launch a 64-bit PE and the build fails with + `ShellExecuteEx failed: Bad EXE format`. Build against a WoW64 prefix without + disturbing an existing one: + + ```sh + export WINEARCH=win64 WINEPREFIX="$HOME/.wine-trimsp64" + wineboot -u + npm run make:win + ``` + + (Wine ≥ 9 supports running 32-bit apps from a `win64` prefix, so a single + prefix is enough.) On Windows none of this applies. + ### Verifying the shipped .exe The `TrimSP.exe` inside the install loads the engine only through WSL, so the @@ -144,5 +160,6 @@ workbench is often driven remotely. After the first-run import, verify: - `wsl.exe` availability is assumed; older Windows builds without WSL2 must install it (`wsl --install`) first. - The macOS runtime is not built. -- Cross-building the `.exe` from Linux additionally needs Wine and Mono (see - above); building on Windows needs neither. +- Cross-building the `.exe` from Linux additionally needs Wine, Mono and a + 64-bit (WoW64) Wine prefix (see above); building on Windows needs none of + these.