fix(windows): make Windows ARM64 build start and package correctly#1809
fix(windows): make Windows ARM64 build start and package correctly#1809aequivalent2 wants to merge 2 commits into
Conversation
ShGKme
left a comment
There was a problem hiding this comment.
Thank you and sorry we missed the arm64. One day we'll have a Windows arm64 device for testing =D
Instead of ignoring arm64, let's actually add support for it.
I'm preparing a new release of the package with arm64 support.
You can test it locally with:
npm i github:nextcloud-deps/vscode-windows-registry#fix/build-arm64If you have any errors on install, just ignore scripts:
npm i --ignore-scripts github:nextcloud-deps/vscode-windows-registry#fix/build-arm64 | // electron-wix-msi (>=5.1.3, in use here) supports 'x86' | 'x64' | 'arm64' as Platform | ||
| // via WiX Toolset >=3.14's candle.exe. Use the actual packaging target instead of a | ||
| // hardcoded 'x64', otherwise win32-arm64 builds ship an MSI mislabeled as x64. | ||
| arch: TARGET_ARCH, |
There was a problem hiding this comment.
The comment isn't entirely true. WiX Toolset >=3.14's candle.exe indeed claims to support arm64.
However, electron-wix-msi@5.1.3 doesn't. It is documented as
Values can be either
x86orx64
https://github.com/electron-userland/electron-wix-msi/blob/v5.1.3/README.md?plain=1#L150-L151
And the source code checks for this property like it is either one or another.
There was a problem hiding this comment.
Probably, we can use arm64 here. But I'm unsure if it is needed. This is only the installer arch, not the installed app, isn't it?
There was a problem hiding this comment.
Do you have any problems with x64 installer?
There was a problem hiding this comment.
electron-userland/electron-wix-msi#150
This issue states that, while not officially supported, it does work.
|
Asking just in case. If this PR is AI Assisted, please, add Details: https://github.com/nextcloud/server/blob/master/.github/CONTRIBUTING.md#ai-assisted-contributions |
…of hardcoded x64 Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Leonhard Ruckert <leonhard.ruckert@outlook.com>
… hardcoded x64 Assisted-by: Claude:claude-sonnet-5 Signed-off-by: Leonhard Ruckert <leonhard.ruckert@outlook.com>
3a4b876 to
927bb6a
Compare
|
Ive added a few things |
|
Is there anything what has to be done now? |
Summary
Two fixes needed for a working win32-arm64 build/release, on top of the packaging groundwork
from #1725:
App crashes immediately on launch on arm64.
getWindowsRegistryItem()(
src/app/windows.utils.ts) threw unconditionally on any non-x64 architecture, before everattempting to load the native
@vscode/windows-registrymodule. SincereadManagedConfig()(src/app/managedConfig.service.ts) is called at module scope inAppConfig.ts, i.e. on every app start, this throw is never caught: Error: getWindowsRegistryItem is only available on x64MSI installer would be mislabeled as x64 even when packaging arm64.
MakerWixinforge.config.jshardcodedarch: 'x64'.electron-wix-msi'sMSICreatordoes not auto-detect architecture (
this.arch = options.arch || 'x86') - it just embedswhatever string it's given as the WiX
Platformattribute (and derivesProgramFiles64FoldervsProgramFilesFolderfrom it). Thearm64-not-supported commentpredates
electron-wix-msi5.1.3 (already the resolved version here), which addedarm64as a valid
Platformvalue via WiX Toolset >=3.14'scandle.exe- confirmed working bycommunity testing in build: add scripts for Windows ARM64 build #1725.
Changes
process.archinstead of a hardcodedwin32-x64path; treat a missing prebuild for the current architecture as a recoverableerror (return
undefined) instead of throwing.TARGET_ARCHvariable (already used for Squirrel installer filenames) forMakerWix'sarchoption instead of a hardcoded'x64'.Both changes are no-ops for existing x64 packaging/behavior.
Testing
main(git am, no conflicts).windows.utils.tschange with esbuild (syntax/bundle check).forge.config.jschange withnode --check.electron-wix-msi@5.1.3(resolved via@electron-forge/maker-wix@7.11.1) acceptsarm64asoptions.archby readingMSICreator's source directly.Related