summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xbuild.sh1
-rw-r--r--dist-assets/windows/installer.nsh37
2 files changed, 24 insertions, 14 deletions
diff --git a/build.sh b/build.sh
index 1de226460f..83073f29fd 100755
--- a/build.sh
+++ b/build.sh
@@ -160,6 +160,7 @@ elif [[ ("$(uname -s)" == "MINGW"*) ]]; then
mullvad.exe
mullvad-problem-report.exe
talpid_openvpn_plugin.dll
+ mullvad-setup.exe
)
fi
for binary in ${binaries[*]}; do
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index c7adccc49e..45404e98fd 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -694,20 +694,6 @@
Push $0
Push $1
- nsExec::ExecToStack '"$SYSDIR\sc.exe" stop mullvadvpn'
-
- # Discard return value
- Pop $0
-
- Sleep 5000
-
- nsExec::ExecToStack '"$SYSDIR\sc.exe" delete mullvadvpn'
-
- # Discard return value
- Pop $0
-
- Sleep 1000
-
# Check command line arguments
Var /GLOBAL FullUninstall
@@ -722,6 +708,29 @@
${EndIf}
Pop $FullUninstall
+ ${If} $FullUninstall != 1
+ # Save the target tunnel state if we're upgrading
+ SetOutPath "$TEMP"
+ File "${BUILD_RESOURCES_DIR}\mullvad-setup.exe"
+ nsExec::ExecToStack '"$TEMP\mullvad-setup.exe" prepare-restart'
+ Pop $0
+ Pop $1
+ ${EndIf}
+
+ nsExec::ExecToStack '"$SYSDIR\sc.exe" stop mullvadvpn'
+
+ # Discard return value
+ Pop $0
+
+ Sleep 5000
+
+ nsExec::ExecToStack '"$SYSDIR\sc.exe" delete mullvadvpn'
+
+ # Discard return value
+ Pop $0
+
+ Sleep 1000
+
log::Log "Running uninstaller for ${PRODUCT_NAME} ${VERSION}"
${RemoveCLIFromEnvironPath}