Subversion Repositories duke3d_hrp

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
257 parkar 1
; Script generated by the HM NIS Edit Script Wizard.
2
 
3
; HM NIS Edit Wizard helper defines
4
!define PRODUCT_NAME "Duke Nukem 3D HRP"
5
!define PRODUCT_VERSION "V 4.0 (321)"
6
!define PRODUCT_WEB_SITE "http://hrp.duke4.net"
7
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\eduke32.exe"
8
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
9
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
10
!define PRODUCT_STARTMENU_REGVAL "NSIS:StartMenuDir"
11
 
12
SetCompressor lzma
13
 
14
; MUI 1.67 compatible ------
15
!include "MUI.nsh"
16
!include "Sections.nsh"
17
 
18
; MUI Settings
19
!define MUI_ABORTWARNING
20
!define MUI_ICON "icon.ico"
21
!define MUI_UNICON "uninst.ico"
22
 
23
!define MUI_HEADERIMAGE
24
!define MUI_WELCOMEFINISHPAGE_BITMAP "page.bmp"
25
!insertmacro MUI_DEFAULT MUI_HEADERIMAGE_BITMAP "banner.bmp"
26
 
27
; Welcome page
28
!define MUI_WELCOMEPAGE_TITLE_3LINES
29
!insertmacro MUI_PAGE_WELCOME
30
 
31
; License page (Build license)
32
!define MUI_PAGE_HEADER_TEXT "Build Source Code License Agreement (Build engine)"
33
!define MUI_PAGE_HEADER_SUBTEXT "Please review the license terms of the build source code before installing."
34
!insertmacro MUI_PAGE_LICENSE "BUILDLIC.TXT"
35
 
36
; License page (GNU public license)
37
!define MUI_PAGE_HEADER_TEXT "GNU Public License Agreement (EDuke32)"
38
!define MUI_PAGE_HEADER_SUBTEXT "Please review the license terms of the EDuke32 port before installing."
39
!insertmacro MUI_PAGE_LICENSE "GNU.TXT"
40
 
41
; License page (HRP art license)
42
!define MUI_PAGE_HEADER_TEXT "HRP Art License Agreement (High Resolution Content)"
43
!define MUI_PAGE_HEADER_SUBTEXT "Please review the license terms of the high resolution content port before installing."
44
!insertmacro MUI_PAGE_LICENSE "hrp_art_license.txt"
45
 
46
; Components page
47
!insertmacro MUI_PAGE_COMPONENTS
48
; Directory page
49
!insertmacro MUI_PAGE_DIRECTORY
50
; Start menu page
51
var ICONS_GROUP
52
!define MUI_STARTMENUPAGE_NODISABLE
53
!define MUI_STARTMENUPAGE_DEFAULTFOLDER "Duke Nukem 3D"
54
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
55
!define MUI_STARTMENUPAGE_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
56
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "${PRODUCT_STARTMENU_REGVAL}"
57
!insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
58
; Instfiles page
59
!insertmacro MUI_PAGE_INSTFILES
60
; Finish page
61
!define MUI_FINISHPAGE_RUN "$INSTDIR\eduke32.exe"
62
!define MUI_FINISHPAGE_RUN_PARAMETERS ""
63
!define MUI_FINISHPAGE_LINK "Visit the HRP website."
64
!define MUI_FINISHPAGE_LINK_LOCATION "http://hrp.duke4.net"
65
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\hrp_readme.txt"
66
!insertmacro MUI_PAGE_FINISH
67
 
68
; Uninstaller pages
69
!insertmacro MUI_UNPAGE_INSTFILES
70
 
71
; Language files
72
!insertmacro MUI_LANGUAGE "English"
73
 
74
; Reserve files
75
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
76
 
77
; MUI end ------
78
 
79
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
80
OutFile "dn3d_hrp-4.0(321).exe"
81
InstallDir "c:\duke3d"
82
InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
83
ShowInstDetails show
84
ShowUnInstDetails show
85
 
86
Section "EDuke32" SEC01
87
  SetOutPath "$INSTDIR"
88
  SetOverwrite ifnewer
89
  File "eduke32\eduke32.exe"
90
  File "eduke32\mapster32.exe"
91
  File "eduke32\m32help.hlp"
92
  File "eduke32\NAMES.H"
93
  File "eduke32\tiles.cfg"
94
 
95
; Shortcuts
96
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
97
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
98
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Duke Nukem 3D (EDuke32).lnk" "$INSTDIR\eduke32.exe"
99
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Mapster32.lnk" "$INSTDIR\eduke32.exe"
100
  !insertmacro MUI_STARTMENU_WRITE_END
101
 
102
SectionEnd
103
 
104
Section "High resolution content" SEC02
105
  SetOutPath "$INSTDIR"
106
  SetOverwrite ifnewer
107
 
108
  File "hrp_content\hrp_readme.txt"
109
  File "hrp_content\hrp_art_license.txt"
110
  SetOutPath "$INSTDIR\autoload\duke3d.grp"
111
  File "hrp_content\duke3d_hrp.zip"
112
SectionEnd
113
 
114
Section "Atomic map hacks" SEC03
115
  SetOutPath "$INSTDIR\autoload\duke3d.grp"
116
  SetOverwrite ifnewer
117
 
118
  File "maphacks_atomic\maphacks.zip"
119
SectionEnd
120
 
121
Section /o "1.3d map hacks" SEC04
122
  SetOutPath "$INSTDIR\autoload\duke3d.grp"
123
  SetOverwrite ifnewer
124
 
125
  File "maphacks_13d\maphacks.zip"
126
SectionEnd
127
 
128
Section "High Quality Muisc" SEC05
129
  SetOutPath "$instdir\autoload\duke3d.grp"
130
  SetOverwrite ifnewer
131
 
132
  File "music\eduke32_mus.zip"
133
SectionEnd
134
 
135
Section "Duke Plus mod" SEC06
136
 
137
   SetOutPath "$INSTDIR"
138
   SetOverwrite ifnewer
139
 
140
   File "duke_plus\DPEFFECTS.html"
141
   File "duke_plus\dukeplus.bat"
142
   File "duke_plus\DukePlus_Manual.html"
143
   File "duke_plus\mapster.bat"
144
 
145
   SetOutPath "$INSTDIR\DukePlus"
146
 
147
   File "duke_plus\DukePlus\dpmaps.zip"
148
   File "duke_plus\DukePlus\dukeplus.def"
149
   File "duke_plus\DukePlus\DUKEPLUS_RESOURCES.zip"
150
   File "duke_plus\DukePlus\EDUKE.CON"
151
   File "duke_plus\DukePlus\tiles005.art"
152
   File "duke_plus\DukePlus\tiles024.art"
153
 
154
   SetOutPath "$INSTDIR\DukePlus\dpcons"
155
 
156
   File "duke_plus\DukePlus\dpcons\DEFSPLUS.CON"
157
   File "duke_plus\DukePlus\dpcons\DUKEPLUS.CON"
158
   File "duke_plus\DukePlus\dpcons\HUDPLUS.CON"
159
   File "duke_plus\DukePlus\dpcons\LIGHTS.CON"
160
   File "duke_plus\DukePlus\dpcons\PLAYERPLUS.CON"
161
   File "duke_plus\DukePlus\dpcons\USERPLUS.CON"
162
 
163
; Shortcuts
164
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
165
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
166
  SetOutPath "$INSTDIR"
167
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Duke Plus.lnk" "$INSTDIR\dukeplus.bat"
168
  !insertmacro MUI_STARTMENU_WRITE_END
169
SectionEnd
170
 
171
Section "-grpinstaller"
172
  SetOutPath "$INSTDIR"
173
  SetOverwrite ifnewer
174
 
175
  File "datainst.exe"
176
 
177
  IfFileExists "$INSTDIR\duke3d.grp" SkipGrpIn
178
     MessageBox MB_YESNO "Do you want to run the GRP installer to find your duke3d.grp file and copy it to your HRP folder?" IDNO SkipGrpIn
179
     DetailPrint "Running grp installer..."
180
     exec "$INSTDIR\datainst.exe"
181
  SkipGrpIn:
182
 
183
SectionEnd
184
 
185
 
186
Function .onSelChange
187
  !insertmacro StartRadioButtons $1
188
    !insertmacro RadioButton ${SEC03}
189
    !insertmacro RadioButton ${SEC04}
190
  !insertmacro EndRadioButtons
191
FunctionEnd
192
 
193
Function .onInit
194
 
195
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${PRODUCT_NAME} ${PRODUCT_VERSION}") i .r1 ?e'
196
  Pop $R0
197
  StrCmp $R0 0 +3
198
    MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
199
    Abort
200
 
201
  SetOutPath $TEMP
202
  File /oname=spltmp.bmp "hrp_splash.bmp"
203
  advsplash::show 1500 600 250 -1 $TEMP\spltmp
204
  Pop $0
205
  Delete $TEMP\spltmp.bmp
206
 
207
  StrCpy $1 ${SEC04} ; Group 1 - Option 1 is selected by default
208
 
209
FunctionEnd
210
 
211
Section -AdditionalIcons
212
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
213
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
214
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\HRP Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
215
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
216
  !insertmacro MUI_STARTMENU_WRITE_END
217
SectionEnd
218
 
219
Section -Post
220
  WriteUninstaller "$INSTDIR\uninst.exe"
221
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\eduke32.exe"
222
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Path" "$INSTDIR"
223
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
224
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
225
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
226
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
227
SectionEnd
228
 
229
; Section descriptions
230
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
231
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "The eDuke32 port that is needed to use the high resolution content. Only uncheck this if you want to install it manualy or if you already have it installed."
232
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "The high resoltution textures and models."
233
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Map hacks for atomic and plutonium pack version of the game. fixes model related problems caused by original level design not being designed for 3D models."
234
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Map hacks for 1.3d full or shareware version of the game. fixes model related problems caused by original level design not being designed for 3D models."
235
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "A pack of high quality replacements for the games music."
236
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "A game enhancement mod with bug fixes and (mostly optional) new features."
237
!insertmacro MUI_FUNCTION_DESCRIPTION_END
238
 
239
Function un.onUninstSuccess
240
  HideWindow
241
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
242
FunctionEnd
243
 
244
Function un.onInit
245
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
246
  Abort
247
FunctionEnd
248
 
249
Section Uninstall
250
  !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
251
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
252
  Delete "$INSTDIR\uninst.exe"
253
;eduke32 files
254
  Delete "$INSTDIR\eduke32.exe"
255
  Delete "$INSTDIR\mapster32.exe"
256
  Delete "$INSTDIR\m32help.hlp"
257
  Delete "$INSTDIR\NAMES.H"
258
  Delete "$INSTDIR\tiles.cfg"
259
 
260
;hrp content
261
  Delete "$INSTDIR\hrp_readme.txt"
262
  Delete "$INSTDIR\hrp_art_license.txt"
263
  Delete "$INSTDIR\autoload\duke3d.grp\duke3d_hrp.zip"
264
  Delete "$INSTDIR\autoload\duke3d.grp\maphacks.zip"
265
 
266
;music content
267
  Delete "$INSTDIR\autoload\duke3d.grp\eduke32_mus.zip"
268
 
269
;duke plus
270
   Delete "$INSTDIR\DPEFFECTS.html"
271
   Delete "$INSTDIR\dukeplus.bat"
272
   Delete "$INSTDIR\DukePlus_Manual.html"
273
   Delete "$INSTDIR\mapster.bat"
274
 
275
   Delete "$INSTDIR\DukePlus\dpmaps.zip"
276
   Delete "$INSTDIR\DukePlus\dukeplus.def"
277
   Delete "$INSTDIR\DukePlus\DUKEPLUS_RESOURCES.zip"
278
   Delete "$INSTDIR\DukePlus\EDUKE.CON"
279
   Delete "$INSTDIR\DukePlus\tiles005.art"
280
   Delete "$INSTDIR\DukePlus\tiles024.art"
281
 
282
   Delete "$INSTDIR\DukePlus\dpcons\DEFSPLUS.CON"
283
   Delete "$INSTDIR\DukePlus\dpcons\DUKEPLUS.CON"
284
   Delete "$INSTDIR\DukePlus\dpcons\HUDPLUS.CON"
285
   Delete "$INSTDIR\DukePlus\dpcons\LIGHTS.CON"
286
   Delete "$INSTDIR\DukePlus\dpcons\PLAYERPLUS.CON"
287
   Delete "$INSTDIR\DukePlus\dpcons\USERPLUS.CON"
288
 
289
   Delete "$INSTDIR\DukePlus\*.log"
290
 
291
   IfFileExists "$INSTDIR\DukePlus\*.cfg" 0 SkipDnPlusCfg
292
   MessageBox MB_YESNO "Do you want to remove Duke Plus configuration files? These files contain the configuration of the Duke Plus mod." IDNO SkipDnPlusCfg
293
     Delete "$INSTDIR\DukePlus\*.cfg"
294
   SkipDnPlusCfg:
295
 
296
   IfFileExists "$INSTDIR\DukePlus\*.sav" 0 SkipDnPlusSav
297
   MessageBox MB_YESNO "Do you want to remove your saved Duke Plus games?" IDNO SkipDnPlusSav
298
     Delete "$INSTDIR\DukePlus\*.sav"
299
   SkipDnPlusSav:
300
 
301
   IfFileExists "$INSTDIR\DukePlus\*.dmo" 0 SkipDnPlusDmo
302
   MessageBox MB_YESNO "Do you want to remove your Duke Plus demo recordings?" IDNO SkipDnPlusDmo
303
     Delete "$INSTDIR\DukePlus\*.dmo"
304
   SkipDnPlusDmo:
305
 
306
 
307
;datainst
308
  Delete "$INSTDIR\datainst.exe"
309
 
310
;cahce files
311
  Delete "$INSTDIR\textures"
312
  Delete "$INSTDIR\*.cache"
313
  Delete "$INSTDIR\DukePlus\textures"
314
  Delete "$INSTDIR\DukePlus\*.cache"
315
 
316
; shortcuts
317
  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
318
  Delete "$SMPROGRAMS\$ICONS_GROUP\HRP Website"
319
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Nukem 3D (EDuke32)"
320
  Delete "$SMPROGRAMS\$ICONS_GROUP\Mapster32"
321
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Plus"
322
  Delete "$SMPROGRAMS\$ICONS_GROUP\Setup video audio and controls"
323
  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
324
  Delete "$SMPROGRAMS\$ICONS_GROUP\HRP Website.lnk"
325
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Nuke.lnkm 3D (EDuke32).lnk"
326
  Delete "$SMPROGRAMS\$ICONS_GROUP\Mapster32"
327
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Plus.lnk"
328
  Delete "$SMPROGRAMS\$ICONS_GROUP\Setup video audio and controls.lnk"
329
 
330
;logfiles
331
  Delete "$INSTDIR\*.log"
332
 
333
;folders
334
  SetOutPath $TEMP
335
  RMDir "$SMPROGRAMS\$ICONS_GROUP"
336
  RMDir "$INSTDIR\autoload\duke3d.grp"
337
  RMDir "$INSTDIR\autoload"
338
  RMDir "$INSTDIR\texcache"
339
  RMDir "$INSTDIR\DukePlus\dpcons"
340
  RMDir "$INSTDIR\DukePlus"
341
  RMDir "$INSTDIR"
342
 
343
  IfFileExists "$INSTDIR\duke3d.grp" 0 SkipGrpUn
344
  MessageBox MB_YESNO "Do you want to remove $INSTDIR\duke3d.grp? This file contains the original Duke Nukem 3D art, maps, sounds etc." IDNO SkipGrpUn
345
    Delete "$INSTDIR\duke3d.grp"
346
  SkipGrpUn:
347
 
348
  IfFileExists "$INSTDIR\*.cfg" 0 SkipCfgUn
349
  MessageBox MB_YESNO "Do you want to remove eDuke32 configuration files? These files contain the configuration of eDuke32 and Mapster32." IDNO SkipCfgUn
350
    Delete "$INSTDIR\duke3d.cfg"
351
  SkipCfgUn:
352
 
353
  IfFileExists "$INSTDIR\*.sav" 0 SkipSavUn
354
  MessageBox MB_YESNO "Do you want to remove your saved games?" IDNO SkipSavUn
355
    Delete "$INSTDIR\*.sav"
356
  SkipSavUn:
357
 
358
  IfFileExists "$INSTDIR\*.dmo" 0 SkipDmoUn
359
  MessageBox MB_YESNO "Do you want to remove your demo recordings?" IDNO SkipDmoUn
360
    Delete "$INSTDIR\*.dmo"
361
  SkipDmoUn:
362
 
363
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
364
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
365
  SetAutoClose true
366
SectionEnd