diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2022-08-23 11:08:13 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2022-08-23 15:34:19 +0200 |
| commit | e2792969dcab94e3f7212abe48914c4dfb1379ea (patch) | |
| tree | 846bdac81faad877e9d873f379c6865c32e5e16e | |
| parent | cd0dea856ca8f0aabde2affb9104a5a958be46af (diff) | |
| download | mullvadvpn-e2792969dcab94e3f7212abe48914c4dfb1379ea.tar.xz mullvadvpn-e2792969dcab94e3f7212abe48914c4dfb1379ea.zip | |
Remove use of --quit-without-disconnect and limitations due to disconnecting
| -rw-r--r-- | dist-assets/linux/before-install.sh | 2 | ||||
| -rw-r--r-- | dist-assets/linux/before-remove.sh | 4 | ||||
| -rw-r--r-- | dist-assets/windows/installer.nsh | 2 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 19 |
4 files changed, 9 insertions, 18 deletions
diff --git a/dist-assets/linux/before-install.sh b/dist-assets/linux/before-install.sh index 6f076b129e..a8efb02adb 100644 --- a/dist-assets/linux/before-install.sh +++ b/dist-assets/linux/before-install.sh @@ -11,6 +11,8 @@ if which systemctl &> /dev/null; then fi fi +# This can be removed when 2022.4 is unsupported. That version is the last version where +# before-remove.sh doesn't kill the GUI on upgrade. pkill -x "mullvad-gui" || true rm -f /var/cache/mullvad-vpn/relays.json diff --git a/dist-assets/linux/before-remove.sh b/dist-assets/linux/before-remove.sh index 340cd272cc..38fcb0364f 100644 --- a/dist-assets/linux/before-remove.sh +++ b/dist-assets/linux/before-remove.sh @@ -1,6 +1,8 @@ #!/usr/bin/env bash set -eu +pkill -x "mullvad-gui" || true + is_number_re='^[0-9]+$' # Check if we're running during an upgrade step on Fedora # https://fedoraproject.org/wiki/Packaging:Scriptlets#Syntax @@ -18,7 +20,5 @@ fi systemctl stop mullvad-daemon.service || true systemctl disable mullvad-daemon.service || true -pkill -x "mullvad-gui" || true - /opt/Mullvad\ VPN/resources/mullvad-setup reset-firewall || echo "Failed to reset firewall" /opt/Mullvad\ VPN/resources/mullvad-setup remove-device || echo "Failed to remove device from account" diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index b699982ad0..7b1f552e2e 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -1155,7 +1155,7 @@ Pop $FullUninstall - nsExec::Exec '"$INSTDIR\Mullvad VPN.exe" --quit-without-disconnect' $0 + nsExec::Exec `taskkill /t /im "${APP_EXECUTABLE_FILENAME}"` $0 Sleep 500 nsExec::Exec `taskkill /f /t /im "${APP_EXECUTABLE_FILENAME}"` $0 diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 4f699bd115..cba52d61e1 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -55,7 +55,6 @@ const linuxSplitTunneling = process.platform === 'linux' && require('./linux-spl const windowsSplitTunneling = process.platform === 'win32' && require('./windows-split-tunneling'); enum CommandLineOptions { - quitWithoutDisconnect = '--quit-without-disconnect', showChanges = '--show-changes', disableResetNavigation = '--disable-reset-navigation', // development only } @@ -126,12 +125,8 @@ class ApplicationMain this.overrideAppPaths(); - // This ensures that only a single instance is running at the same time, but also exits if - // there's no already running instance when the quit without disconnect flag is supplied. - if ( - !app.requestSingleInstanceLock() || - process.argv.includes(CommandLineOptions.quitWithoutDisconnect) - ) { + // This ensures that only a single instance is running at the same time. + if (!app.requestSingleInstanceLock()) { app.quit(); return; } @@ -221,14 +216,8 @@ class ApplicationMain }; private addSecondInstanceEventHandler() { - app.on('second-instance', (_event, argv, _workingDirectory) => { - if (argv.includes(CommandLineOptions.quitWithoutDisconnect)) { - // Quit if another instance is started with the quit without disconnect flag. - app.quit(); - } else { - // If no action was provided to the new instance the window is opened. - this.userInterface?.showWindow(); - } + app.on('second-instance', (_event, _argv, _workingDirectory) => { + this.userInterface?.showWindow(); }); } |
