summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorOdd Stranne <odd@mullvad.net>2018-05-04 11:02:48 +0200
committerLinus Färnstrand <linus@mullvad.net>2018-06-08 11:13:02 +0200
commited1e3a789ba00d9f68593acaa6905966abdba5af (patch)
treee85d7a20a2ffc94e0d5dfd1991dcfde3e62fd00e
parent019649596e6831b9fe308a36f6c067f882d3c215 (diff)
downloadmullvadvpn-ed1e3a789ba00d9f68593acaa6905966abdba5af.tar.xz
mullvadvpn-ed1e3a789ba00d9f68593acaa6905966abdba5af.zip
Stop and delete service during uninstallation
-rw-r--r--dist-assets/installer.nsh43
1 files changed, 37 insertions, 6 deletions
diff --git a/dist-assets/installer.nsh b/dist-assets/installer.nsh
index 20f1aa5ea4..b072526e48 100644
--- a/dist-assets/installer.nsh
+++ b/dist-assets/installer.nsh
@@ -148,12 +148,6 @@
Push $0
Push $1
- nsExec::ExecToStack '"sc.exe" delete mullvadvpn'
-
- # Discard return value
- # The service may have not been installed previously
- Pop $0
-
nsExec::ExecToStack '"$INSTDIR\resources\mullvad-daemon.exe" --register-service'
Pop $0
@@ -219,3 +213,40 @@
Pop $R0
!macroend
+
+###############################################################################
+#
+# Uninstaller
+#
+###############################################################################
+
+#
+# customRemoveFiles
+#
+# This macro is activated just after the removal of files have started.
+# Shortcuts etc may have been removed but application files remain.
+#
+!macro customRemoveFiles
+
+ Push $0
+
+ nsExec::ExecToStack '"sc.exe" stop mullvadvpn'
+
+ # Discard return value
+ Pop $0
+
+ Sleep 5000
+
+ nsExec::ExecToStack '"sc.exe" delete mullvadvpn'
+
+ # Discard return value
+ Pop $0
+
+ Sleep 1000
+
+ # Original removal functionality provided by Electron-builder
+ RMDir /r $INSTDIR
+
+ Pop $0
+
+!macroend