Skip to content

fix(windows): make Windows ARM64 build start and package correctly - #1809

Open
aequivalent2 wants to merge 1 commit into
nextcloud:mainfrom
aequivalent2:fix/windows-registry-arch-aware
Open

fix(windows): make Windows ARM64 build start and package correctly#1809
aequivalent2 wants to merge 1 commit into
nextcloud:mainfrom
aequivalent2:fix/windows-registry-arch-aware

Conversation

@aequivalent2

@aequivalent2 aequivalent2 commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Summary

One fixes needed for a working win32-arm64 build/release, on top of the packaging groundwork
from #1725:

  1. App crashes immediately on launch on arm64. getWindowsRegistryItem()
    (src/app/windows.utils.ts) threw unconditionally on any non-x64 architecture, before ever
    attempting to load the native @vscode/windows-registry module. Since
    readManagedConfig() (src/app/managedConfig.service.ts) is called at module scope in
    AppConfig.ts, i.e. on every app start, this throw is never caught: Error: getWindowsRegistryItem is only available on x64

Changes

  • Resolve the native Registry module path per process.arch instead of a hardcoded
    win32-x64 path; treat a missing prebuild for the current architecture as a recoverable
    error (return undefined) instead of throwing.

Testing

  • Applied and verified both patches against a fresh clone of main (git am, no conflicts).
  • Verified windows.utils.ts change with esbuild (syntax/bundle check).

Related

Copilot AI review requested due to automatic review settings July 12, 2026 17:18

This comment was marked as low quality.

@nickvergessen nickvergessen added bug Something isn't working os: Windows 🪟 labels Jul 13, 2026
@nickvergessen
nickvergessen requested a review from ShGKme July 13, 2026 11:30

@ShGKme ShGKme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-arm64

If you have any errors on install, just ignore scripts:

npm i --ignore-scripts github:nextcloud-deps/vscode-windows-registry#fix/build-arm64 

Comment thread forge.config.js Outdated
Comment thread src/app/windows.utils.ts
Comment thread src/app/windows.utils.ts Outdated
Comment thread src/app/windows.utils.ts Outdated
@ShGKme

ShGKme commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Asking just in case. If this PR is AI Assisted, please, add Assisted-by: AGENT_NAME:MODEL_VERSION to the commit description.

Details: https://github.com/nextcloud/server/blob/master/.github/CONTRIBUTING.md#ai-assisted-contributions

@aequivalent2
aequivalent2 force-pushed the fix/windows-registry-arch-aware branch from 3a4b876 to 927bb6a Compare July 13, 2026 21:08
@ShGKme ShGKme added the AI assisted This PR contains AI-assisted commits label Jul 14, 2026
@aequivalent2

Copy link
Copy Markdown
Contributor Author

Ive added a few things

@aequivalent2

aequivalent2 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Is there anything what has to be done now?

This comment was marked as low quality.

@github-actions

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@aequivalent2

Copy link
Copy Markdown
Contributor Author

Sorry is @ShGKme is there a problem with my pull request?

@ShGKme

ShGKme commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@aequivalent2 To have a complete arm64 support here, we needed a new release of the nextcloud-deps/vscode-windows-registry and to have it updated in the app.

It was only done at the end of the last week in:

Now you can rebase your PR onto main, and ar64 support you added should actually work.

@ShGKme ShGKme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you adjust some comments to not have a misleading description for the electron-wix-msi and to not have too many extra comments? Comments describing the code are an additional part of the code that needs to be maintained (be consistent with the code changes in the future).

All the rest is good, but a rebase onto main is needed to test with the actual @vscode/windows-registry version, supporting arm64.

Comment thread src/app/windows.utils.ts Outdated
Comment thread src/app/windows.utils.ts Outdated
Comment thread forge.config.js Outdated
@aequivalent2
aequivalent2 force-pushed the fix/windows-registry-arch-aware branch from 4e88f8c to 32e5f19 Compare July 30, 2026 05:51
@aequivalent2

Copy link
Copy Markdown
Contributor Author

Hello, the new electron wixx 8.0.0 Beta added an Arch Check which prevents arm64, thats why i removed this change.
Further More i have deleted unecessary comments

@aequivalent2
aequivalent2 requested a review from ShGKme July 30, 2026 05:54

@ShGKme ShGKme left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ShGKme

ShGKme commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

the new electron wixx 8.0.0 Beta added an Arch Check which prevents arm64, thats why i removed this change.

Hmm, who could have done that

image

I may propose to add the arm64 here, but it might be complicated without having arm64 explicitly supported by the electron-wix-msi. Even if it works, it must be a part of the contract.

As far as I understand, having an x64 installer should have no negative effect on the installed arm64 application. The app itself is arm64, it is inthalled in the same C:\Program Files. So the only problem is the installer name (it is generated as Windows-x64-) and, maybe, sharing the upgrade code.

Could you confirm, there are no issues with the x64 installer for the arm64 app on Windows ARM on your side?

@aequivalent2

Copy link
Copy Markdown
Contributor Author

With this check it is no longer possible to package the msi, you can see the error in the workflow run below

https://github.com/aequivalent2/nextcloud-desktop-arm64/actions/runs/30529848769/job/90829330314

@ShGKme

ShGKme commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

I understand passing arm64 won't work here (as per the link above, there is an explicit check for only the supported values).

But it is unclear from the action if it's running with arch: 'x64'.

With this check it is no longer possible to package the msi, you can see the error in the workflow run below

https://github.com/aequivalent2/nextcloud-desktop-arm64/actions/runs/30529848769/job/90829330314

Are you sure, this is a run with arch: 'x64'? Not with your previous commit?

@ShGKme

ShGKme commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Could you also remove the 2 last commits?
The 3rd just reverts the 2nd, so they change nothing together.

@aequivalent2

aequivalent2 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Hello, this run worked with the previous version without the check, now there is a failure

https://github.com/aequivalent2/nextcloud-desktop-arm64/actions/runs/30432968591/job/90514166207

package:arm64:msi was possible before but is not possible anymore i guess

@aequivalent2
aequivalent2 force-pushed the fix/windows-registry-arch-aware branch from 32e5f19 to 5597648 Compare July 31, 2026 08:03
…of hardcoded x64

getWindowsRegistryItem() threw unconditionally on any non-x64 architecture
before ever attempting to load the native @vscode/windows-registry module,
crashing the app on startup on arm64. Resolve the native module path per
process.arch instead of a hardcoded win32-x64 path, and treat a missing
prebuild for the current architecture as a recoverable error (return
undefined) instead of throwing.

Assisted-by: Claude:claude-sonnet-5

Signed-off-by: Leonhard Ruckert <leonhard.ruckert@outlook.com>
@aequivalent2
aequivalent2 force-pushed the fix/windows-registry-arch-aware branch from 5597648 to 2d61313 Compare July 31, 2026 08:04
@aequivalent2
aequivalent2 requested a review from ShGKme July 31, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits bug Something isn't working feedback-requested os: Windows 🪟

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants