summaryrefslogtreecommitdiff
path: root/win/template.nsi
diff options
context:
space:
mode:
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