summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2018-09-10 18:43:40 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2018-09-12 12:09:54 +0200
commitb78b43a051efa2ca36d2676b338ca47bf2b489cc (patch)
tree8841217d8da9f2747a21ee8c205e6103ea1d102f
parent7907fa0def72fe335d07da07470825dcddca61dd (diff)
[feat] abort installer if the app is still running
Otherwise, the error is a bit more cryptic for the user. - Related: #14
-rwxr-xr-xwin/template.nsi11
1 files changed, 11 insertions, 0 deletions
diff --git a/win/template.nsi b/win/template.nsi
index 567e584..ae860b6 100755
--- a/win/template.nsi
+++ b/win/template.nsi
@@ -29,6 +29,7 @@ RequestExecutionLevel admin
!macroend
+
!define BITMAP_FILE riseupvpn.bmp
!define MUI_ICON "..\assets\$app_name_lower.ico"
@@ -45,6 +46,16 @@ RequestExecutionLevel admin
Section "InstallFiles"
+ ; first we try to delete the systray, locked by the app.
+ ClearErrors
+ Delete 'C:\Program Files\$app_name\bitmask-systray.exe'
+ IfErrors 0 noError
+
+ ; Error handling
+ MessageBox MB_OK|MB_ICONEXCLAMATION "$app_name is Running. Please close it, and then run this installer again."
+ Abort
+
+ noError:
ExecShellWait "runas" "$INSTDIR\nssm.exe" 'stop $app_name_lower-helper'
ExecShellWait "runas" "$INSTDIR\nssm.exe" 'remove $app_name_lower-helper confirm'