diff options
author | kali kaneko (leap communications) <kali@leap.se> | 2020-04-22 18:51:03 +0200 |
---|---|---|
committer | kali kaneko (leap communications) <kali@leap.se> | 2020-04-30 22:10:26 +0200 |
commit | e3baef0e9e36e1b0f3e899ef8e83520004b50a29 (patch) | |
tree | aaacbf4184867dde69191e94e777da299fe0fa91 | |
parent | 498139be7d015023a2cef1dca79e4506edd6f4e5 (diff) |
[pkg] another try at removing the nssm helper
-rwxr-xr-x | branding/templates/windows/template.nsi | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/branding/templates/windows/template.nsi b/branding/templates/windows/template.nsi index ce05d27..f9f8ea1 100755 --- a/branding/templates/windows/template.nsi +++ b/branding/templates/windows/template.nsi @@ -46,7 +46,23 @@ RequestExecutionLevel admin Section "InstallFiles" - ; first we try to delete the systray, locked by the app. + ; first we try to delete the helper, in case it is still the nssm-style + ClearErrors + Delete 'C:\Program Files\$applicationName\bitmask_helper.exe' + IfErrors 0 noErrorHelper + + ; this could fail: uninstalling old nssm helper + ExecShellWait "runas" '"$INSTDIR\nssm.exe" stop $applicationNameLower-helper' + ExecShellWait "runas" '"$INSTDIR\nssm.exe" remove $applicationNameLower-helper confirm' + IfErrors 0 noErrorHelper + + ; Error handling + MessageBox MB_OK|MB_ICONEXCLAMATION "$applicationNameLower-helper cannot be deleted. Please try to remove it manually, and then run this installer again." + Abort + + noErrorHelper: + + ; now we try to delete the systray, locked by the app. ClearErrors Delete 'C:\Program Files\$applicationName\bitmask-vpn.exe' IfErrors 0 noError @@ -98,11 +114,8 @@ Section /o "TAP Virtual Ethernet Adapter" SecTAP SectionEnd Section "Uninstall" - ; this could fail: uninstalling old nssm helper - ExecShellWait "runas" '"$INSTDIR\nssm.exe" stop $applicationNameLower-helper' - ExecShellWait "runas" '"$INSTDIR\nssm.exe" remove $applicationNameLower-helper confirm' - ; now we uninstall the new-style go helper + ; we uninstall the new-style go helper ExecShellWait "runas" '"$INSTDIR\bitmask_helper.exe" remove' |