Skip to content

feat: support upgrading from ARM to ARM, rather than upgrading to x64 in window and linux #9059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 4, 2025

Conversation

beyondkmp
Copy link
Collaborator

@beyondkmp beyondkmp commented Apr 25, 2025

Currently, there is no distinction between ARM and x64 on Windows and Linux, causing ARM devices to download the x64 version, which then fails to open. This PR aims to resolve this issue.

macOS already supports ARM and has a more complex Rosetta mode, so it will retain the original filtering mechanism. Only Linux and Windows will adopt the new filtering approach.

Copy link

changeset-bot bot commented Apr 25, 2025

🦋 Changeset detected

Latest commit: 5234af6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
electron-updater Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@beyondkmp beyondkmp requested a review from mmaietta April 27, 2025 02:26
@mmaietta
Copy link
Collaborator

This looks good! Just to confirm, which OS' has this been tested already on? Anything I need to do on my side?

@beyondkmp
Copy link
Collaborator Author

@mmaietta I have tested it on Windows x64, Windows ARM64, and Mac Intel. If you have time, you can help test on Mac ARM and Linux ARM platforms.

@mmaietta
Copy link
Collaborator

For Windows ARM, did you test the flow where the x64 installation is being updated to an arm64 build? I think there might be some issues there in terms of registry key cleanup?

@beyondkmp
Copy link
Collaborator Author

I just tested it, and I didn’t notice any issues. The EXE installer is 32-bit and runs normally. Could you specify which registry issues you’re referring to?

@mmaietta
Copy link
Collaborator

Sorry, did a double check and it's not the registry key

Do we need to be concerned with previous installed location since x86 and x64 are different directories? Will changing the arch of the update cause the previous installation to not be removed?

defines[arch === Arch.x64 ? "APP_DIR_64" : arch === Arch.arm64 ? "APP_DIR_ARM64" : "APP_DIR_32"] = dir

@beyondkmp
Copy link
Collaborator Author

beyondkmp commented May 4, 2025

Sorry, did a double check and it's not the registry key

Do we need to be concerned with previous installed location since x86 and x64 are different directories? Will changing the arch of the update cause the previous installation to not be removed?

defines[arch === Arch.x64 ? "APP_DIR_64" : arch === Arch.arm64 ? "APP_DIR_ARM64" : "APP_DIR_32"] = dir

The code you're referring to is for the portable EXE. Since the portable EXE doesn’t require installation, there should be no issues. Currently, NSIS installs everything under the AppData directory, and the installation directories for x86 and x64 are the same.

if (this.isPortable && options.useZip) {
for (const [arch, dir] of archs.entries()) {
defines[arch === Arch.x64 ? "APP_DIR_64" : arch === Arch.arm64 ? "APP_DIR_ARM64" : "APP_DIR_32"] = dir
}
} else if (USE_NSIS_BUILT_IN_COMPRESSOR && archs.size === 1) {

The only difference is when using NSIS's "Install for all users" option: x86 installs to C:\Program Files (x86), while x64 installs to C:\Program Files. However, the uninstallation process for the EXE directly calls the old version’s EXE to remove the app, so there shouldn’t be any problems with that either.

@beyondkmp beyondkmp merged commit cb77508 into electron-userland:master May 4, 2025
18 checks passed
@github-actions github-actions bot mentioned this pull request May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants