summaryrefslogtreecommitdiff
path: root/win/template.nsi
diff options
context:
space:
mode:
authorkali <kali@win>2018-06-26 23:15:27 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2018-06-27 19:31:48 +0200
commit05bc3260b9c958a72096e7a28956f4666bd65603 (patch)
tree0f0dc160a353420a0469f7f96504ce9eae3832a5 /win/template.nsi
parent3668e25f418bcf64535dfad082b5d0310b9a30cb (diff)
[pkg] fix service run on install
Diffstat (limited to 'win/template.nsi')
-rwxr-xr-xwin/template.nsi26
1 files changed, 16 insertions, 10 deletions
diff --git a/win/template.nsi b/win/template.nsi
index 0c92684..009be7b 100755
--- a/win/template.nsi
+++ b/win/template.nsi
@@ -3,7 +3,7 @@
Name "$app_name"
RequestExecutionLevel admin
-Outfile $app_name-installer.exe
+Outfile "..\dist\$app_name-installer.exe"
;TODO make the installdir configurable - and set it in the registry.
InstallDir "C:\Program Files\$app_name\"
@@ -12,7 +12,6 @@ InstallDir "C:\Program Files\$app_name\"
!define MUI_PAGE_CUSTOMFUNCTION_PRE WelcomePageSetupLinkPre
!define MUI_PAGE_CUSTOMFUNCTION_SHOW WelcomePageSetupLinkShow
-; TODO fixme icons PATH
!define MUI_ICON "..\assets\$app_name_lower.ico"
!define MUI_UNICON "..\assets\$app_name_lower.ico"
@@ -58,35 +57,42 @@ FunctionEnd
Section "InstallFiles"
SetOutPath $INSTDIR
- WriteUninstaller $INSTDIR\uninstaller.exe
+ WriteUninstaller $INSTDIR\uninstall.exe
+
+ ;Start Menu
+ createDirectory "$SMPROGRAMS\$app_name\"
+ createShortCut "$SMPROGRAMS\$app_name\$app_name.lnk" "$INSTDIR\bitmask-systray.exe" "" "$INSTDIR\$app_name_lower.ico"
File "readme.txt"
File "..\staging\nssm.exe"
+ File "..\assets\$app_name_lower.ico"
$extra_install_files
+
SectionEnd
Section "InstallService"
- ; TODO: make sure that this is not running before attempting
- ; to install it.
+ ; Easy service management thanks to nssm
+ ExecWait '"$INSTDIR\nssm.exe" remove $app_name_lower-helper confirm'
ExecWait '"$INSTDIR\nssm.exe" install $app_name_lower-helper "$INSTDIR\bitmask_helper.exe"'
ExecWait '"$INSTDIR\nssm.exe" set $app_name_lower-helper AppDirectory "$INSTDIR"'
- ExecWait '"$INSTDIR"\nssm.exe start $app_name_lower-helper'
- ; Exec cmd.exe
+ ExecWait '"$INSTDIR\nssm.exe" start $app_name_lower-helper'
SectionEnd
Section "Uninstall"
ExecWait '"$INSTDIR"\nssm.exe stop $app_name_lower-helper'
- ExecWait '"$INSTDIR"\nssm.exe remove $app_name_lower-helper'
+ ExecWait '"$INSTDIR"\nssm.exe remove $app_name_lower-helper confirm'
- Delete $INSTDIR\uninstaller.exe
Delete $INSTDIR\readme.txt
Delete $INSTDIR\nssm.exe
$extra_uninstall_files
+
+ ; uninstaller must be always the last thing to remove
+ Delete $INSTDIR\uninstall.exe
SectionEnd
-
+
;----------------------------------------
;Languages