summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-05-15 13:24:33 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-05-15 13:24:33 +0200
commitd68e5be0572893d19f82699beab8948674ba2b31 (patch)
tree16ed18c0760af4f14b623fb406b04a6a67f4dff4
parentd1e88e72910669d0ef71c114ffa889095ebafd66 (diff)
parent16eaed359c4818e11bd1318536cb5b0a6e2976b1 (diff)
downloadmullvadvpn-d68e5be0572893d19f82699beab8948674ba2b31.tar.xz
mullvadvpn-d68e5be0572893d19f82699beab8948674ba2b31.zip
Merge branch 'uninstall-old-app'
-rw-r--r--CHANGELOG.md2
-rwxr-xr-xdist-assets/pkg-scripts/postinstall4
-rwxr-xr-xdist-assets/pkg-scripts/preinstall20
3 files changed, 25 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bcf9c1425e..aaa037bfb6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -37,6 +37,8 @@ Line wrap the file at 100 chars. Th
- Add `version` subcommand in the CLI to show information about current versions.
- Add a flag to daemon to print log entries to standard output without timestamps.
- Filter out and ignore DNS lookup results for api.mullvad.net that are bogus (private etc.)
+- Make the macOS pkg installer locate and uninstall any 2018.1 version of the app before installing
+ itself.
### Changed
- Change all occurrences of "MullvadVPN" into "Mullvad VPN", this affects
diff --git a/dist-assets/pkg-scripts/postinstall b/dist-assets/pkg-scripts/postinstall
index 2180d91ee4..c2d3b3f7e1 100755
--- a/dist-assets/pkg-scripts/postinstall
+++ b/dist-assets/pkg-scripts/postinstall
@@ -5,7 +5,9 @@ set -eu
LOG_DIR=/var/log/mullvad-daemon
mkdir -p $LOG_DIR
-exec 2>&1 > $LOG_DIR/install.log
+exec 2>&1 > $LOG_DIR/postinstall.log
+
+echo "Running postinstall at $(date)"
INSTALL_DIR=$2
DAEMON_PLIST_PATH="/Library/LaunchDaemons/net.mullvad.daemon.plist"
diff --git a/dist-assets/pkg-scripts/preinstall b/dist-assets/pkg-scripts/preinstall
new file mode 100755
index 0000000000..08ada60d4d
--- /dev/null
+++ b/dist-assets/pkg-scripts/preinstall
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+set -eux
+
+LOG_DIR=/var/log/mullvad-daemon
+
+mkdir -p $LOG_DIR
+exec 2>&1 > $LOG_DIR/preinstall.log
+
+echo "Running preinstall at $(date)"
+
+OLD_INSTALL_DIR="/Applications/MullvadVPN.app"
+
+if [ -d "$OLD_INSTALL_DIR" ]; then
+ echo "Found old Mullvad VPN install at $OLD_INSTALL_DIR. Stopping and uninstalling"
+ pkill MullvadVPN || true
+ pkill mullvad-daemon || true
+ rm -rf "$OLD_INSTALL_DIR"
+fi
+