summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2018-10-25 12:13:23 +0200
committerAndrej Mihajlov <and@mullvad.net>2018-10-25 12:13:23 +0200
commitf40dc3bdb12f02babc2d3a636f5ef78c0c98c362 (patch)
treea50007858683764c232a3ea1e545fdf0803c6f89
parent93a0a8a3cb891e25df1b38f3419a241dc49a92a1 (diff)
downloadmullvadvpn-f40dc3bdb12f02babc2d3a636f5ef78c0c98c362.tar.xz
mullvadvpn-f40dc3bdb12f02babc2d3a636f5ef78c0c98c362.zip
Upgrade to Electron 3.0.6
-rw-r--r--gui/packages/desktop/package.json2
-rw-r--r--gui/packages/desktop/src/renderer/lib/autostart.js25
-rw-r--r--gui/yarn.lock8
3 files changed, 6 insertions, 29 deletions
diff --git a/gui/packages/desktop/package.json b/gui/packages/desktop/package.json
index 8b52a9447c..5005d21151 100644
--- a/gui/packages/desktop/package.json
+++ b/gui/packages/desktop/package.json
@@ -49,7 +49,7 @@
"chai-as-promised": "^7.1.1",
"chai-spies": "^1.0.0",
"cross-env": "^5.1.3",
- "electron": "^3.0.4",
+ "electron": "^3.0.6",
"electron-builder": "^20.28",
"electron-devtools-installer": "^2.2.1",
"electron-mocha": "^6.0.4",
diff --git a/gui/packages/desktop/src/renderer/lib/autostart.js b/gui/packages/desktop/src/renderer/lib/autostart.js
index 35c74b1dd2..7617b9b13a 100644
--- a/gui/packages/desktop/src/renderer/lib/autostart.js
+++ b/gui/packages/desktop/src/renderer/lib/autostart.js
@@ -2,14 +2,12 @@
import fs from 'fs';
import path from 'path';
-import { execFile } from 'child_process';
import { promisify } from 'util';
import { remote } from 'electron';
import log from 'electron-log';
const DESKTOP_FILE_NAME = 'mullvad-vpn.desktop';
-const execFileAsync = promisify(execFile);
const mkdirAsync = promisify(fs.mkdir);
const statAsync = promisify(fs.stat);
const symlinkAsync = promisify(fs.symlink);
@@ -34,28 +32,7 @@ export function getOpenAtLogin() {
}
export async function setOpenAtLogin(openAtLogin: boolean) {
- // setLoginItemSettings is broken on macOS and cannot delete login items.
- // Issue: https://github.com/electron/electron/issues/10880
- if (process.platform === 'darwin') {
- if (openAtLogin === false) {
- // process.execPath in renderer process points to the sub-bundle of Electron Helper.
- // This regular expression extracts the path to the app bundle, which is the first occurrence of
- // file with .app extension.
- const matches = process.execPath.match(/([a-z0-9 ]+)\.app/i);
- if (matches && matches.length > 1) {
- const bundleName = matches[1];
- const appleScript = `on run argv
- set itemName to item 1 of argv
- tell application "System Events" to delete login item itemName
- end run`;
- await execFileAsync('osascript', ['-e', appleScript, bundleName]);
- } else {
- log.error(`Cannot extract the app bundle name from ${process.execPath}`);
- }
- } else {
- remote.app.setLoginItemSettings({ openAtLogin });
- }
- } else if (process.platform === 'linux') {
+ if (process.platform === 'linux') {
try {
const desktopFilePath = path.join('/usr/share/applications', DESKTOP_FILE_NAME);
const autostartDir = path.join(remote.app.getPath('appData'), 'autostart');
diff --git a/gui/yarn.lock b/gui/yarn.lock
index d8bcb06c0f..526976b20f 100644
--- a/gui/yarn.lock
+++ b/gui/yarn.lock
@@ -3913,10 +3913,10 @@ electron-window@^0.8.0:
dependencies:
is-electron-renderer "^2.0.0"
-electron@^3.0.4:
- version "3.0.4"
- resolved "https://registry.yarnpkg.com/electron/-/electron-3.0.4.tgz#9b45a0171ac424d4c134721c9cf2a891b99e80f2"
- integrity sha512-GuZ4xCmV8wNNfkUAOdmOmgkYYaTQj5LATzc2i/b3MGhoXghnjECCgxo5yW+G2BeKM+R30cg69KA03tRzmIFxxQ==
+electron@^3.0.6:
+ version "3.0.6"
+ resolved "https://registry.yarnpkg.com/electron/-/electron-3.0.6.tgz#2d7b4ed521e90c69d83ffe5696db173b0e7b2473"
+ integrity sha512-MqwvA6IM0IDvUgPo/zHasmLMn3eYhMJ2I0qTNfQtxwqdoo762UlFS+upmMgcnCXPcGMGDWi3wtZhNir9nEw1kA==
dependencies:
"@types/node" "^8.0.24"
electron-download "^4.1.0"