diff options
author | Christoph Settgast <csett86@web.de> | 2021-03-13 21:37:45 +0100 |
---|---|---|
committer | Saúl Ibarra Corretgé <s@saghul.net> | 2021-03-15 00:13:00 +0100 |
commit | 9b09a4bfa9d875cd45fd81879a3c1895fd372502 (patch) | |
tree | 6772883544c4225ab42a0ebac7a0b3ed2ab03084 /main.js | |
parent | b41de51ed25375acb526690c716ffbe7b41ec7d7 (diff) |
Switch mac build to universal build
Apple's documentation suggests that apps should be shipped as universal binaries
to simplify the process for the users. See eg. https://developer.apple.com/documentation/apple-silicon/porting-your-macos-apps-to-apple-silicon
Also update electron-updater to latest version (matching electron-builder version)
as part of this.
Signed-off-by: Christoph Settgast <csett86@web.de>
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -23,6 +23,7 @@ const URL = require('url'); const config = require('./app/features/config'); const { openExternalLink } = require('./app/features/utils/openExternalLink'); const pkgJson = require('./package.json'); +const { existsSync } = require('fs'); const showDevTools = Boolean(process.env.SHOW_DEV_TOOLS) || (process.argv.indexOf('--show-dev-tools') > -1); @@ -170,7 +171,18 @@ function createJitsiMeetWindow() { }); // Path to root directory. - const basePath = isDev ? __dirname : app.getAppPath(); + let basePath = isDev ? __dirname : app.getAppPath(); + + // runtime detection on mac if this is a universal build with app-arm64.asar' + // as prepared in https://github.com/electron/universal/blob/master/src/index.ts + // if universal build, load the arch-specific real asar as the app does not load otherwise + if (process.platform === 'darwin' && existsSync(path.join(app.getAppPath(), '..', 'app-arm64.asar'))) { + if (process.arch === 'arm64') { + basePath = app.getAppPath().replace('app.asar', 'app-arm64.asar'); + } else if (process.arch === 'x64') { + basePath = app.getAppPath().replace('app.asar', 'app-x64.asar'); + } + } // URL for index.html which will be our entry point. const indexURL = URL.format({ |