diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2018-09-07 15:10:16 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2018-09-07 15:10:16 +0200 |
| commit | a413e20904b0402b714bcf1c05f7265a0d112898 (patch) | |
| tree | dd8a4fbd8c1ad5b22b20e528a7e55570216439e9 | |
| parent | 8122b9c4ff83eff6ac4d353a0a015789ca6bf1db (diff) | |
| parent | 09b52755c3b5143cd8ee6f364e265283a34bf8ea (diff) | |
| download | mullvadvpn-a413e20904b0402b714bcf1c05f7265a0d112898.tar.xz mullvadvpn-a413e20904b0402b714bcf1c05f7265a0d112898.zip | |
Merge branch 'improve-macos-install-uninstall'
| -rw-r--r-- | CHANGELOG.md | 5 | ||||
| -rwxr-xr-x | dist-assets/pkg-scripts/postinstall | 2 | ||||
| -rwxr-xr-x | dist-assets/uninstall_macos.sh | 40 | ||||
| -rwxr-xr-x[-rw-r--r--] | gui/packages/desktop/electron-builder.yml | 2 |
4 files changed, 49 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index cb9ffc0bae..72c377ae00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,9 @@ Line wrap the file at 100 chars. Th - Add firewall rules allowing traffic to the SSDP/WS-discover multicast IP, 239.255.255.250, if local area network sharing is activated. This allows discovery of devices using these protocols. +#### macOS +- Add uninstall script that can uninstall and remove all the files installed by the app. + #### Windows - Extend uninstaller to also remove logs, cache and optionally settings. - Add installation log (%PROGRAMDATA%\Mullvad VPN\install.log). @@ -51,6 +54,8 @@ Line wrap the file at 100 chars. Th #### macOS - Fix edge cases when window's arrow appeared misaligned and pointed to the wrong menubar item. +- Make the pkg installer kill any running GUI process after installation is done. Prevents + accidentally running an old GUI with a newer daemon. ### Changed - The "Buy more credit" button is changed to open a dedicated account login page instead of one diff --git a/dist-assets/pkg-scripts/postinstall b/dist-assets/pkg-scripts/postinstall index fd3752ae3b..e213c73b62 100755 --- a/dist-assets/pkg-scripts/postinstall +++ b/dist-assets/pkg-scripts/postinstall @@ -42,6 +42,8 @@ DAEMON_PLIST=$(cat <<-EOM EOM ) +pkill -x "Mullvad VPN" || echo "Unable to kill GUI, not running?" +sleep 1 launchctl unload -w $DAEMON_PLIST_PATH echo "$DAEMON_PLIST" > $DAEMON_PLIST_PATH launchctl load -w $DAEMON_PLIST_PATH diff --git a/dist-assets/uninstall_macos.sh b/dist-assets/uninstall_macos.sh new file mode 100755 index 0000000000..df82a35fae --- /dev/null +++ b/dist-assets/uninstall_macos.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -ue + +read -p "Are you sure you want to stop and uninstall Mullvad VPN? (y/n) " +if [[ "$REPLY" =~ [Yy]$ ]]; then + echo "Uninstalling Mullvad VPN ..." +else + echo "Aborting uninstall" + exit 0 +fi + +echo "Stopping GUI process ..." +sudo pkill -x "Mullvad VPN" || echo "No GUI process found" + +echo "Stopping and unloading mullvad-daemon system daemon ..." +DAEMON_PLIST_PATH="/Library/LaunchDaemons/net.mullvad.daemon.plist" +sudo launchctl unload -w "$DAEMON_PLIST_PATH" +sudo rm -f "$DAEMON_PLIST_PATH" + +echo "Removing app from /Applications ..." +sudo rm -rf /Applications/Mullvad\ VPN.app + +read -p "Do you want to delete the log and cache files the app has created? (y/n) " +if [[ "$REPLY" =~ [Yy]$ ]]; then + sudo rm -rf /var/log/mullvad-vpn /var/root/Library/Caches/mullvad-vpn + for user in /Users/*; do + user_log_dir="$user/Library/Logs/Mullvad VPN" + if [[ -d "$user_log_dir" ]]; then + echo "Deleting GUI logs at $user_log_dir" + sudo rm -rf "$user_log_dir" + fi + done +fi + +read -p "Do you want to delete the Mullvad VPN settings? (y/n) " +if [[ "$REPLY" =~ [Yy]$ ]]; then + sudo rm -rf /etc/mullvad-vpn +fi + diff --git a/gui/packages/desktop/electron-builder.yml b/gui/packages/desktop/electron-builder.yml index e94bdb0d13..6a5884962d 100644..100755 --- a/gui/packages/desktop/electron-builder.yml +++ b/gui/packages/desktop/electron-builder.yml @@ -50,6 +50,8 @@ mac: to: . - from: ../../../dist-assets/binaries/macos/openvpn to: . + - from: ../../../dist-assets/uninstall_macos.sh + to: ./uninstall.sh pkg: allowAnywhere: false |
