summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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'