From b78b43a051efa2ca36d2676b338ca47bf2b489cc Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Mon, 10 Sep 2018 18:43:40 +0200 Subject: [feat] abort installer if the app is still running Otherwise, the error is a bit more cryptic for the user. - Related: #14 --- win/template.nsi | 11 +++++++++++ 1 file changed, 11 insertions(+) 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' -- cgit v1.2.3