diff options
| author | David Lönnhager <david.l@mullvad.net> | 2020-03-09 09:55:55 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2020-03-16 12:54:27 +0100 |
| commit | 1c834ab5bd0b04bcebb41d69b4e8c708fda1ebe6 (patch) | |
| tree | 6b98ad67767c84725eb0925c9f245ca93942bfea | |
| parent | d9105937064bb0f308cb6f2d4e11f680fcb49b9a (diff) | |
| download | mullvadvpn-1c834ab5bd0b04bcebb41d69b4e8c708fda1ebe6.tar.xz mullvadvpn-1c834ab5bd0b04bcebb41d69b4e8c708fda1ebe6.zip | |
Use setup tool to save the target state when upgrading
| -rwxr-xr-x | build.sh | 1 | ||||
| -rw-r--r-- | dist-assets/windows/installer.nsh | 37 |
2 files changed, 24 insertions, 14 deletions
@@ -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} |
