-
Notifications
You must be signed in to change notification settings - Fork 2
/
basic.nsi
251 lines (176 loc) · 5.4 KB
/
basic.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
SetCompress off
!define setup "evacsim_release_0.1.exe"
!define company "USM School of Computing"
!define prodname "EVacSim"
; text file to open in notepad after installation
; linked as "release notes"
!define notefile "todo.txt"
; license text file
!define licensefile license.txt
; icons must be Microsoft .ICO files
!define icon "eagle.ico"
; installer background screen
!define screenimage sportlogo.bmp
; file containing list of file-installation commands
!define files "files.nsi"
; file containing list of file-uninstall commands
!define unfiles "unfiles.nsi"
; registry stuff
!define regkey "Software\${company}\${prodname}"
!define uninstkey "Software\Microsoft\Windows\CurrentVersion\Uninstall\${prodname}"
!define startmenu "$SMPROGRAMS\${company}\${prodname}"
!define uninstaller "uninstall.exe"
!define exec "Evacuation_Renderer.exe"
;--------------------------------
XPStyle on
ShowInstDetails show
ShowUninstDetails show
Name "${prodname}"
Caption "${prodname}"
!ifdef icon
Icon "${icon}"
!endif
OutFile "${setup}"
SetDateSave on
SetDatablockOptimize on
CRCCheck on
InstallDir "$PROGRAMFILES\${company}\${prodname}"
InstallDirRegKey HKLM "${regkey}" ""
!ifdef licensefile
LicenseText "License"
LicenseData "${licensefile}"
!endif
; pages
; we keep it simple - leave out selectable installation types
!ifdef licensefile
Page license
!endif
; Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
AutoCloseWindow false
ShowInstDetails show
!ifdef screenimage
; set up background image
; uses BgImage plugin
Function .onGUIInit
; extract background BMP into temp plugin directory
InitPluginsDir
File /oname=$PLUGINSDIR\1.bmp "${screenimage}"
BgImage::SetBg /NOUNLOAD /FILLSCREEN $PLUGINSDIR\1.bmp
BgImage::Redraw /NOUNLOAD
FunctionEnd
Function .onGUIEnd
; Destroy must not have /NOUNLOAD so NSIS will be able to unload and delete BgImage before it exits
BgImage::Destroy
FunctionEnd
!endif
; These are the programs that are needed
Section -Prerequisites
SetOutPath $INSTDIR\Prerequisites
MessageBox MB_YESNO "Install XVid Codec? Needed for video compression" /SD IDYES IDNO endXvid
File "XviD-1.1.3-28062007.exe"
ExecWait "$INSTDIR\Prerequisites\XviD-1.1.3-28062007.exe"
Goto endXVid
endXVid:
MessageBox MB_YESNO "Install ImageMagick? Needed for multi-pane videos" /SD IDYES IDNO endim
File "ImageMagick-6.4.1-0-Q16-windows-static.exe"
ExecWait "$INSTDIR\Prerequisites\ImageMagick-6.4.1-0-Q16-windows-static.exe"
Goto endim
endim:
SectionEnd
; beginning (invisible) section
Section
WriteRegStr HKLM "${regkey}" "Install_Dir" "$INSTDIR"
; write uninstall strings
WriteRegStr HKLM "${uninstkey}" "DisplayName" "${company} ${prodname} (remove only)"
WriteRegStr HKLM "${uninstkey}" "UninstallString" '"$INSTDIR\${uninstaller}"'
!ifdef filetype
WriteRegStr HKCR "${filetype}" "" "${prodname}"
!endif
WriteRegStr HKCR "${prodname}\Shell\open\command\" "" '"$INSTDIR\${exec} "%1"'
!ifdef icon
WriteRegStr HKCR "${prodname}\DefaultIcon" "" "$INSTDIR\${icon}"
!endif
SetOutPath $INSTDIR
; package all files, recursively, preserving attributes
; assume files are in the correct places
;File /a "${exec}"
!ifdef licensefile
File /a "${licensefile}"
!endif
!ifdef notefile
File /a "${notefile}"
!endif
!ifdef icon
File /a "${icon}"
!endif
; any application-specific files
!ifdef files
!include "${files}"
!endif
WriteUninstaller "${uninstaller}"
SectionEnd
; create shortcuts
Section
CreateDirectory "${startmenu}"
SetOutPath "$INSTDIR\renderer" ; for working directory
!ifdef icon
CreateShortCut "${startmenu}\${prodname}.lnk" "$INSTDIR\renderer\${exec}" "" "$INSTDIR\${icon}"
!else
CreateShortCut "${startmenu}\${prodname}.lnk" "$INSTDIR\renderer\${exec}"
!endif
!ifdef notefile
CreateShortCut "${startmenu}\Quick Start Guide.lnk" "$INSTDIR\docs\quick_start_guide.txt"
!endif
!ifdef notefile
CreateShortCut "${startmenu}\README.lnk" "$INSTDIR\readme.txt"
!endif
!ifdef notefile
CreateShortCut "${startmenu}\Videos.lnk "$INSTDIR\videos"
!endif
!ifdef notefile
CreateShortCut "${startmenu}\Scripts.lnk "$INSTDIR\scripts"
!endif
!ifdef notefile
CreateShortCut "${startmenu}\Maps.lnk "$INSTDIR\obj"
!endif
!ifdef helpfile
CreateShortCut "${startmenu}\Documentation.lnk "$INSTDIR\${helpfile}"
!endif
!ifdef website
WriteINIStr "${startmenu}\web site.url" "InternetShortcut" "URL" ${website}
; CreateShortCut "${startmenu}\Web Site.lnk "${website}" "URL"
!endif
!ifdef notefile
;ExecShell "open" "$INSTDIR\${notefile}"
!endif
SectionEnd
; Uninstaller
; All section names prefixed by "Un" will be in the uninstaller
UninstallText "This will uninstall ${prodname}."
!ifdef icon
UninstallIcon "${icon}"
!endif
Section "Uninstall"
DeleteRegKey HKLM "${uninstkey}"
DeleteRegKey HKLM "${regkey}"
Delete "${startmenu}\*.*"
Delete "${startmenu}"
!ifdef licensefile
Delete "$INSTDIR\${licensefile}"
!endif
!ifdef notefile
Delete "$INSTDIR\${notefile}"
!endif
!ifdef icon
Delete "$INSTDIR\${icon}"
!endif
Delete "$INSTDIR\${exec}"
!ifdef unfiles
!include "${unfiles}"
!endif
SectionEnd