-
Notifications
You must be signed in to change notification settings - Fork 7
/
installer.nsi
executable file
·319 lines (299 loc) · 10.7 KB
/
installer.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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
!define PRODUCT_NAME "Tweak Battle"
!ifndef PRODUCT_VERSION
!define PRODUCT_VERSION "0.1alpha"
!endif
!define PRODUCT_PUBLISHER "Tweakers.net"
!define PRODUCT_WEB_SITE "https://github.com/DemonTPx/smashbattle"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\Battle.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
!ifndef OUT_FILENAME
!define OUT_FILENAME "tweakbattle-setup.exe"
!endif
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE "gpl-2.0.txt"
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!define MUI_FINISHPAGE_RUN "$INSTDIR\Battle.exe"
!define MUI_FINISHPAGE_RUN_PARAMETERS "-f"
!insertmacro MUI_PAGE_FINISH
; Uninstaller pages
!insertmacro MUI_UNPAGE_INSTFILES
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "${OUT_FILENAME}"
InstallDir "$PROGRAMFILES\Tweak Battle"
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite try
File "$%SMASHBATTLE_LIB%\vcredist_x86.exe"
ExecWait "$INSTDIR\vcredist_x86.exe /q"
File "$%SMASHBATTLE_LIB%\libcurl.dll"
File "$%SMASHBATTLE_LIB%\libFLAC-8.dll"
File "$%SMASHBATTLE_LIB%\libmikmod-2.dll"
File "$%SMASHBATTLE_LIB%\libogg-0.dll"
File "$%SMASHBATTLE_LIB%\libvorbis-0.dll"
File "$%SMASHBATTLE_LIB%\libvorbisfile-3.dll"
File "$%SMASHBATTLE_LIB%\SDL.dll"
File "$%SMASHBATTLE_LIB%\SDL_mixer.dll"
File "$%SMASHBATTLE_LIB%\SDL_net.dll"
File "$%SMASHBATTLE_LIB%\smpeg.dll"
File "$%SMASHBATTLE_LIB%\zlib1.dll"
File "Release\Battle.exe"
CreateDirectory "$SMPROGRAMS\Tweak Battle"
CreateShortCut "$SMPROGRAMS\Tweak Battle\Tweak Battle.lnk" "$INSTDIR\Battle.exe" "-f"
CreateShortCut "$SMPROGRAMS\Tweak Battle\Tweak Battle (Windowed mode).lnk" "$INSTDIR\Battle.exe"
CreateShortCut "$DESKTOP\Tweak Battle.lnk" "$INSTDIR\Battle.exe"
SetOutPath "$INSTDIR\gfx"
SetOverwrite try
File "Battle\gfx\arjen.bmp"
File "Battle\gfx\arnoud.bmp"
File "Battle\gfx\bert.bmp"
File "Battle\gfx\bg_black.bmp"
File "Battle\gfx\bg_blue.bmp"
File "Battle\gfx\bg_grey.bmp"
File "Battle\gfx\bg_orange.bmp"
File "Battle\gfx\bg_white.bmp"
File "Battle\gfx\bomb.bmp"
File "Battle\gfx\bryan.bmp"
File "Battle\gfx\cannon.bmp"
File "Battle\gfx\chick.bmp"
File "Battle\gfx\common.bmp"
File "Battle\gfx\cups.bmp"
File "Battle\gfx\femme.bmp"
File "Battle\gfx\font_l.bmp"
File "Battle\gfx\font_m.bmp"
File "Battle\gfx\font_s.bmp"
File "Battle\gfx\frederik.bmp"
File "Battle\gfx\gatling.bmp"
File "Battle\gfx\jeroen.bmp"
File "Battle\gfx\joost.bmp"
File "Battle\gfx\jur.bmp"
File "Battle\gfx\kees.bmp"
File "Battle\gfx\kim.bmp"
File "Battle\gfx\koen.bmp"
File "Battle\gfx\mark.bmp"
File "Battle\gfx\misha.bmp"
File "Battle\gfx\paul.bmp"
File "Battle\gfx\player1hp.bmp"
File "Battle\gfx\player2hp.bmp"
File "Battle\gfx\pmarkers.bmp"
File "Battle\gfx\powerups.bmp"
File "Battle\gfx\props.bmp"
File "Battle\gfx\ray.bmp"
File "Battle\gfx\robert.bmp"
File "Battle\gfx\SB.bmp"
File "Battle\gfx\SB.ico"
File "Battle\gfx\SB.png"
File "Battle\gfx\shield.bmp"
File "Battle\gfx\sim.bmp"
File "Battle\gfx\tiles.bmp"
File "Battle\gfx\tino.bmp"
File "Battle\gfx\weapons.bmp"
File "Battle\gfx\wilbert.bmp"
File "Battle\gfx\wout.bmp"
SetOutPath "$INSTDIR\music"
File "Battle\music\a_hero_rises.ogg"
File "Battle\music\graveyard.ogg"
File "Battle\music\hydro_dreams.ogg"
File "Battle\music\space_farer.ogg"
File "Battle\music\victory.ogg"
SetOutPath "$INSTDIR\sfx"
File "Battle\sfx\airstrike.wav"
File "Battle\sfx\blip.wav"
File "Battle\sfx\bounce.wav"
File "Battle\sfx\countdown.wav"
File "Battle\sfx\explode.wav"
File "Battle\sfx\go.wav"
File "Battle\sfx\hit.wav"
File "Battle\sfx\item.wav"
File "Battle\sfx\jump.wav"
File "Battle\sfx\laser.wav"
File "Battle\sfx\pause.wav"
File "Battle\sfx\select.wav"
File "Battle\sfx\select_character.wav"
File "Battle\sfx\shield.wav"
File "Battle\sfx\shoot.wav"
File "Battle\sfx\youlose.wav"
SetOutPath "$INSTDIR\stage"
File "Battle\stage\blastbowl.lvl"
File "Battle\stage\boulderdash.lvl"
File "Battle\stage\chicken_run.lvl"
File "Battle\stage\chick_invasion.lvl"
File "Battle\stage\chick_invasion_ii.lvl"
File "Battle\stage\commongrounds.lvl"
File "Battle\stage\ducknhunt.lvl"
File "Battle\stage\easy_does_it.lvl"
File "Battle\stage\lamoustache.lvl"
File "Battle\stage\piepit.lvl"
File "Battle\stage\pitfall.lvl"
File "Battle\stage\pitofdeath.lvl"
File "Battle\stage\platformalley.lvl"
File "Battle\stage\pogostick.lvl"
File "Battle\stage\rabbithole.lvl"
File "Battle\stage\slipnslide.lvl"
File "Battle\stage\snowfight.lvl"
File "Battle\stage\stayhigh.lvl"
File "Battle\stage\thefunnel.lvl"
File "Battle\stage\titlescreen.lvl"
File "Battle\stage\trainingdojo.lvl"
File "Battle\stage\tryout.lvl"
SectionEnd
Section -AdditionalIcons
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\Tweak Battle\Uninstall.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\Battle.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Battle.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
FunctionEnd
Function un.onInit
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
Abort
FunctionEnd
Section Uninstall
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\stage\tryout.lvl"
Delete "$INSTDIR\stage\trainingdojo.lvl"
Delete "$INSTDIR\stage\titlescreen.lvl"
Delete "$INSTDIR\stage\thefunnel.lvl"
Delete "$INSTDIR\stage\stayhigh.lvl"
Delete "$INSTDIR\stage\snowfight.lvl"
Delete "$INSTDIR\stage\slipnslide.lvl"
Delete "$INSTDIR\stage\rabbithole.lvl"
Delete "$INSTDIR\stage\pogostick.lvl"
Delete "$INSTDIR\stage\platformalley.lvl"
Delete "$INSTDIR\stage\pitofdeath.lvl"
Delete "$INSTDIR\stage\pitfall.lvl"
Delete "$INSTDIR\stage\piepit.lvl"
Delete "$INSTDIR\stage\lamoustache.lvl"
Delete "$INSTDIR\stage\easy_does_it.lvl"
Delete "$INSTDIR\stage\ducknhunt.lvl"
Delete "$INSTDIR\stage\commongrounds.lvl"
Delete "$INSTDIR\stage\chick_invasion_ii.lvl"
Delete "$INSTDIR\stage\chick_invasion.lvl"
Delete "$INSTDIR\stage\chicken_run.lvl"
Delete "$INSTDIR\stage\boulderdash.lvl"
Delete "$INSTDIR\stage\blastbowl.lvl"
Delete "$INSTDIR\sfx\youlose.wav"
Delete "$INSTDIR\sfx\shoot.wav"
Delete "$INSTDIR\sfx\shield.wav"
Delete "$INSTDIR\sfx\select_character.wav"
Delete "$INSTDIR\sfx\select.wav"
Delete "$INSTDIR\sfx\pause.wav"
Delete "$INSTDIR\sfx\laser.wav"
Delete "$INSTDIR\sfx\jump.wav"
Delete "$INSTDIR\sfx\item.wav"
Delete "$INSTDIR\sfx\hit.wav"
Delete "$INSTDIR\sfx\go.wav"
Delete "$INSTDIR\sfx\explode.wav"
Delete "$INSTDIR\sfx\countdown.wav"
Delete "$INSTDIR\sfx\bounce.wav"
Delete "$INSTDIR\sfx\blip.wav"
Delete "$INSTDIR\sfx\airstrike.wav"
Delete "$INSTDIR\music\victory.ogg"
Delete "$INSTDIR\music\space_farer.ogg"
Delete "$INSTDIR\music\hydro_dreams.ogg"
Delete "$INSTDIR\music\graveyard.ogg"
Delete "$INSTDIR\music\a_hero_rises.ogg"
Delete "$INSTDIR\gfx\wout.bmp"
Delete "$INSTDIR\gfx\wilbert.bmp"
Delete "$INSTDIR\gfx\weapons.bmp"
Delete "$INSTDIR\gfx\tino.bmp"
Delete "$INSTDIR\gfx\tiles.bmp"
Delete "$INSTDIR\gfx\sim.bmp"
Delete "$INSTDIR\gfx\shield.bmp"
Delete "$INSTDIR\gfx\SB.png"
Delete "$INSTDIR\gfx\SB.ico"
Delete "$INSTDIR\gfx\SB.bmp"
Delete "$INSTDIR\gfx\robert.bmp"
Delete "$INSTDIR\gfx\ray.bmp"
Delete "$INSTDIR\gfx\props.bmp"
Delete "$INSTDIR\gfx\powerups.bmp"
Delete "$INSTDIR\gfx\pmarkers.bmp"
Delete "$INSTDIR\gfx\player2hp.bmp"
Delete "$INSTDIR\gfx\player1hp.bmp"
Delete "$INSTDIR\gfx\paul.bmp"
Delete "$INSTDIR\gfx\misha.bmp"
Delete "$INSTDIR\gfx\mark.bmp"
Delete "$INSTDIR\gfx\maite.bmp"
Delete "$INSTDIR\gfx\kim.bmp"
Delete "$INSTDIR\gfx\kees.bmp"
Delete "$INSTDIR\gfx\jur.bmp"
Delete "$INSTDIR\gfx\joost.bmp"
Delete "$INSTDIR\gfx\jeroen.bmp"
Delete "$INSTDIR\gfx\gatling.bmp"
Delete "$INSTDIR\gfx\frederik.bmp"
Delete "$INSTDIR\gfx\font_s.bmp"
Delete "$INSTDIR\gfx\font_m.bmp"
Delete "$INSTDIR\gfx\font_l.bmp"
Delete "$INSTDIR\gfx\femme.bmp"
Delete "$INSTDIR\gfx\cups.bmp"
Delete "$INSTDIR\gfx\common.bmp"
Delete "$INSTDIR\gfx\chick.bmp"
Delete "$INSTDIR\gfx\cannon.bmp"
Delete "$INSTDIR\gfx\bryan.bmp"
Delete "$INSTDIR\gfx\bomb.bmp"
Delete "$INSTDIR\gfx\bg_white.bmp"
Delete "$INSTDIR\gfx\bg_orange.bmp"
Delete "$INSTDIR\gfx\bg_grey.bmp"
Delete "$INSTDIR\gfx\bg_blue.bmp"
Delete "$INSTDIR\gfx\bg_black.bmp"
Delete "$INSTDIR\gfx\bert.bmp"
Delete "$INSTDIR\gfx\arnoud.bmp"
Delete "$INSTDIR\gfx\arjen.bmp"
Delete "$INSTDIR\gfx\anne_willemijn.bmp"
Delete "$INSTDIR\smpeg.dll"
Delete "$INSTDIR\zlib1.dll"
Delete "$INSTDIR\SDL_net.dll"
Delete "$INSTDIR\SDL_mixer.dll"
Delete "$INSTDIR\SDL.dll"
Delete "$INSTDIR\libvorbisfile-3.dll"
Delete "$INSTDIR\libvorbis-0.dll"
Delete "$INSTDIR\libogg-0.dll"
Delete "$INSTDIR\libmikmod-2.dll"
Delete "$INSTDIR\libFLAC-8.dll"
Delete "$INSTDIR\libcurl.dll"
Delete "$INSTDIR\Battle.exe"
Delete "$INSTDIR\vcredist_x86.exe"
Delete "$SMPROGRAMS\Tweak Battle\Uninstall.lnk"
Delete "$DESKTOP\Tweak Battle.lnk"
Delete "$SMPROGRAMS\Tweak Battle\Tweak Battle.lnk"
RMDir "$SMPROGRAMS\Tweak Battle"
RMDir "$INSTDIR\stage"
RMDir "$INSTDIR\sfx"
RMDir "$INSTDIR\music"
RMDir "$INSTDIR\gfx"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd