-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtrebuchet.nsi
executable file
·130 lines (104 loc) · 3.4 KB
/
trebuchet.nsi
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
;NSIS installer for trebuchet with stand alone options.
;
;When making yourself, change "TMP_DIR" to correct location
SetCompress auto
SetCompressor /solid lzma
RequestExecutionLevel admin
!define NICK_NAME "Trebuchet"
!define PROD_NAME "Trebuchet Tk"
!define VER_MAJOR 1
!define VER_MINOR 82
!define VER_REVISION 0
!define VER_BUILD 1
!define VER_FILE "1082"
!define VER_DISPLAY "1.082"
!define TMP_DIR "C:\TMP\Install"
!define BUILD_DIR "${TMP_DIR}\Trebuchet"
;-------------------------------
;Use modern GUI
;-------------------------------
!include "MUI.nsh"
;---------
;Variables
;---------
Var MUI_TEMP
Var STARTMENU_FOLDER
;-------------------------
; General Config
;-------------------------
XPStyle on
Name "${PROD_NAME}"
Caption "${PROD_NAME} ${VER_DISPLAY} (build ${VER_BUILD}) - Setup"
OutFile "${TMP_DIR}\${NICK_NAME}${VER_FILE}b${VER_BUILD}.exe"
InstallDir "$PROGRAMFILES\${NICK_NAME}"
;LicenseData "${BUILD_DIR}\LICENSE"
;------------------
;Interface Settings
;------------------
;Define custom look and images to be used
!define MUI_ABORTWARNING
;!define MUI_LANGDLL_ALWAYSSHOW
;!define MUI_ICON "install.ico"
;!define MUI_UNICON "uninstall.ico"
;!define MUI_HEADERIMAGE_BITMAP "header.bmp"
;!define MUI_HEADERIMAGE_UNBITMAP "header.bmp"
;!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
;!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
;-----------------------------
;Pages to be used in the setup
;-----------------------------
;General pages
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "${BUILD_DIR}\LICENSE"
;!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
;Start Menu Folder Page Configuration
!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER
;Installation progress and finish
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
;Uninstallation pages
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;---------
;Languages
;---------
;Define installer languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Section
Section "Install"
SetOutPath "$INSTDIR"
File "${BUILD_DIR}\*"
File /r "${BUILD_DIR}\lib"
File /r "${BUILD_DIR}\docs"
File /r "${BUILD_DIR}\cacerts"
File /r "${BUILD_DIR}\icons"
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
;Create Start menu shortcuts
CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Trebuchet.lnk" "$OUTDIR\Trebuchet.tcl" "" "$OUTDIR\icons\Treb.ico"
CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$OUTDIR\Uninstall.exe"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
;ADD YOUR OWN STUFF HERE!
Delete "$INSTDIR\pkgs\*.*"
Delete "$INSTDIR\lib\*.*"
Delete "$INSTDIR\docs\*.*"
Delete "$INSTDIR\cacerts\*.*"
Delete "$INSTDIR\icons\*.*"
Delete "$INSTDIR\*.*"
RMDir /r "$INSTDIR"
;Remove shortcut
!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP
Delete "$SMPROGRAMS\$MUI_TEMP\Trebuchet.lnk"
Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk"
RMDir "$SMPROGRAMS\$MUI_TEMP" ;Only if empty, so it won't delete other shortcuts
SectionEnd