Skip to content
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

How to force electron-updater to update to the x64 package on M1 Macs? #6851

Open
rathboma opened this issue May 9, 2022 · 5 comments
Open

Comments

@rathboma
Copy link

rathboma commented May 9, 2022

Hey folks,

Firstly, and as always -- thank you for maintaining electron-builder. I couldn't make an app solo without all of your amazing work.

I have a problem in that one of my dependencies (oracle's database instant client - c++ library) is not available for ARM64, only for x86_64.

I can deal with this in the app, but I need to have a way to make sure that users who install the x86 version can upgrade to the newest x86 version...even if they're on an M1 Mac and using Rosetta.

Right now the default behavior is to upgrade to the ARM64 version, which totally makes sense, except in this specific circumstance.

Ideally I'd like a way to override, this, is it possible? I looked at examples, but wasn't sure how to override the architecture for AutoUpdater

@mmaietta
Copy link
Collaborator

Hi there!
If there's no arm64 version available for download, I was under the impression that electron-updater would simply fall back to the default (x64). It was implemented as part of #5524
It was to prevent users from being stuck on an arm64 version until another arm64 update was distributed.

@rathboma
Copy link
Author

Yes correct! However I still want to publish an ARM64 version alongside my x86 version.

I need M1 users, who are using the x86 version of the app to be able to continue using that version, rather than being upgraded to the ARM version, when both are available

@rathboma
Copy link
Author

rathboma commented May 11, 2022

Sorry I think I'm not clear enough what this is for. Here's the situation with my app for more clarity:

  • I publish both ARM and x86 Mac binaries
  • My app needs to offer connections to Oracle Database
  • To do this, the node-oracledb driver must be able to find the Oracle Instant Client files, which are separately downloaded and placed somewhere like /Users/matthew/oracle.
  • However, Oracle only publishes MacOS 'Instant Client' libraries for x86 devices

This means
If a user on an M1 Mac wants to connect to Oracle Database, they must use the x86 version of my app with Rosetta

That's why I need to force x86 only upgrades

  • If a user opts to install the x86 version of my app in order to connect to Oracle, I don't want to auto-upgrade them to the ARM64 version, because it would break their app.

Does that make more sense?

@mmaietta
Copy link
Collaborator

Hmmm, in that case, I think a more simple solution is to create the update file for your purposes. What if we compile both binaries, but split in to separate steps? The 2nd run will generate the latest-mac.yml and overwrite the previously generated file, so latest-mac.yml would only contain details for x64.

electron-builder --mac --arm64
electron-builder --mac --x64

In terms of the PR, I'm honestly not a fan of adding a specific macOS-only flag to the base updater class when it's only applicable to arm64 builds.
Instead, I'm wondering if creating a callback like shouldDownloadUpdate could be a universal approach for allowing the host application to determine if the artifact satisfies certain conditions.

@mltucker
Copy link

@mmaietta The problem with this solution is that it would update all arm users to the latest x64 version, correct? The goal is to have arm binaries upgrade to arm and x64 binaries upgrade to x64.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants