Skip to content

Commit fda930e

Browse files
committed
Switch MacOS users to the Apple Silicon build if they have Apple-branded CPUs
1 parent 9532bf2 commit fda930e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

app/src/browser/autoupdate-manager.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { dialog, nativeImage } from 'electron';
33
import { EventEmitter } from 'events';
44
import path from 'path';
5+
import os from 'os';
56
import fs from 'fs';
67
import { localized } from '../intl';
78

@@ -49,6 +50,15 @@ export default class AutoUpdateManager extends EventEmitter {
4950
channel: this.preferredChannel,
5051
};
5152

53+
// If we're on the x64 Mac build, but the machine has an Apple-branded
54+
// processor, switch the user to the arm64 build.
55+
if (params.platform === 'darwin' && process.arch === 'x64') {
56+
const cpus = os.cpus();
57+
if (cpus.length && cpus[0].model.startsWith('Apple ')) {
58+
params.arch = 'arm64';
59+
}
60+
}
61+
5262
let host = `updates.getmailspring.com`;
5363
if (this.config.get('env') === 'staging') {
5464
host = `updates-staging.getmailspring.com`;

0 commit comments

Comments
 (0)