From 3c20f6ea1e0169a75e2c77828a8ecbb73bf4f147 Mon Sep 17 00:00:00 2001
From: "kali kaneko (leap communications)" <kali@leap.se>
Date: Tue, 7 Apr 2020 19:07:12 +0200
Subject: [PATCH] [pkg] change installer to use new windows service

---
 branding/templates/windows/template.nsi | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/branding/templates/windows/template.nsi b/branding/templates/windows/template.nsi
index 2be707b0..e98854f9 100755
--- a/branding/templates/windows/template.nsi
+++ b/branding/templates/windows/template.nsi
@@ -56,8 +56,6 @@ Section "InstallFiles"
   Abort
 
   noError:
-  ExecShellWait "runas" "$INSTDIR\nssm.exe" 'stop $applicationNameLower-helper'
-  ExecShellWait "runas" "$INSTDIR\nssm.exe" 'remove $applicationNameLower-helper confirm'
 
   SetOutPath $INSTDIR 
   WriteUninstaller $INSTDIR\uninstall.exe
@@ -78,7 +76,6 @@ Section "InstallFiles"
   createShortCut "$SMPROGRAMS\$applicationName\$applicationName.lnk" "$INSTDIR\bitmask-vpn.exe" "" "$INSTDIR\icon.ico"
 
   File "readme.txt"
-  File "..\staging\nssm.exe"
   File "/oname=icon.ico" "..\assets\icon.ico"
 
   $extra_install_files
@@ -86,10 +83,8 @@ Section "InstallFiles"
 SectionEnd
 
 Section "InstallService"
-  ; Easy service management thanks to nssm
-  ExecWait '"$INSTDIR\nssm.exe" install $applicationNameLower-helper "$INSTDIR\bitmask_helper.exe"'
-  ExecWait '"$INSTDIR\nssm.exe" set $applicationNameLower-helper AppDirectory "$INSTDIR"'
-  ExecWait '"$INSTDIR\nssm.exe" start $applicationNameLower-helper'
+  ExecWait '"$INSTDIR\bitmask_helper.exe" install'
+  ExecWait '"$INSTDIR\bitmask_helper.exe" start'
 SectionEnd
 
 Section /o "TAP Virtual Ethernet Adapter" SecTAP
@@ -103,11 +98,9 @@ Section /o "TAP Virtual Ethernet Adapter" SecTAP
 SectionEnd
 
 Section "Uninstall"
-  ExecShellWait "runas" "$INSTDIR\nssm.exe" 'stop $applicationNameLower-helper'
-  ExecShellWait "runas" "$INSTDIR\nssm.exe" 'remove $applicationNameLower-helper confirm'
+  ExecShellWait "runas" "$INSTDIR\bitmask_helper.exe" 'remove'
 
   Delete $INSTDIR\readme.txt
-  Delete $INSTDIR\nssm.exe
   Delete $INSTDIR\helper.log
   Delete "$SMPROGRAMS\$applicationName\$applicationName.lnk"
   RMDir "$SMPROGRAMS\$applicationName\"
-- 
GitLab