summaryrefslogtreecommitdiffhomepage
path: root/gui/packages
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 /gui/packages
parent93a0a8a3cb891e25df1b38f3419a241dc49a92a1 (diff)
downloadmullvadvpn-f40dc3bdb12f02babc2d3a636f5ef78c0c98c362.tar.xz
mullvadvpn-f40dc3bdb12f02babc2d3a636f5ef78c0c98c362.zip
Upgrade to Electron 3.0.6
Diffstat (limited to 'gui/packages')
-rw-r--r--gui/packages/desktop/package.json2
-rw-r--r--gui/packages/desktop/src/renderer/lib/autostart.js25
2 files changed, 2 insertions, 25 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');