Subversion Repositories duke3d_hrp

Rev

Rev 673 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
727 leod 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"
111
  File "hrp_content\duke3d_hrp.zip"
112
SectionEnd
113
 
114
Section "High Quality Muisc" SEC05
115
  SetOutPath "$instdir\autoload"
116
  SetOverwrite ifnewer
117
 
118
  File "music\eduke32_mus.zip"
119
SectionEnd
120
 
121
Section "Duke Plus mod" SEC06
122
 
123
   SetOutPath "$INSTDIR"
124
   SetOverwrite ifnewer
125
 
126
   File "duke_plus\DPEFFECTS.html"
127
   File "duke_plus\dukeplus.bat"
128
   File "duke_plus\DukePlus_Manual.html"
129
   File "duke_plus\mapster.bat"
130
 
131
   SetOutPath "$INSTDIR\DukePlus"
132
 
133
   File "duke_plus\DukePlus\dpmaps.zip"
134
   File "duke_plus\DukePlus\dukeplus.def"
135
   File "duke_plus\DukePlus\DUKEPLUS_RESOURCES.zip"
136
   File "duke_plus\DukePlus\EDUKE.CON"
137
   File "duke_plus\DukePlus\tiles005.art"
138
   File "duke_plus\DukePlus\tiles024.art"
139
 
140
   SetOutPath "$INSTDIR\DukePlus\dpcons"
141
 
142
   File "duke_plus\DukePlus\dpcons\DEFSPLUS.CON"
143
   File "duke_plus\DukePlus\dpcons\DUKEPLUS.CON"
144
   File "duke_plus\DukePlus\dpcons\HUDPLUS.CON"
145
   File "duke_plus\DukePlus\dpcons\LIGHTS.CON"
146
   File "duke_plus\DukePlus\dpcons\PLAYERPLUS.CON"
147
   File "duke_plus\DukePlus\dpcons\USERPLUS.CON"
148
 
149
; Shortcuts
150
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
151
  CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
152
  SetOutPath "$INSTDIR"
153
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Duke Plus.lnk" "$INSTDIR\dukeplus.bat"
154
  !insertmacro MUI_STARTMENU_WRITE_END
155
SectionEnd
156
 
157
Section "-grpinstaller"
158
  SetOutPath "$INSTDIR"
159
  SetOverwrite ifnewer
160
 
161
  File "datainst.exe"
162
 
163
  IfFileExists "$INSTDIR\duke3d.grp" SkipGrpIn
164
     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
165
     DetailPrint "Running grp installer..."
166
     exec "$INSTDIR\datainst.exe"
167
  SkipGrpIn:
168
 
169
SectionEnd
170
 
171
 
172
Function .onSelChange
173
  !insertmacro StartRadioButtons $1
174
    !insertmacro RadioButton ${SEC03}
175
    !insertmacro RadioButton ${SEC04}
176
  !insertmacro EndRadioButtons
177
FunctionEnd
178
 
179
Function .onInit
180
 
181
  System::Call 'kernel32::CreateMutexA(i 0, i 0, t "${PRODUCT_NAME} ${PRODUCT_VERSION}") i .r1 ?e'
182
  Pop $R0
183
  StrCmp $R0 0 +3
184
    MessageBox MB_OK|MB_ICONEXCLAMATION "The installer is already running."
185
    Abort
186
 
187
  SetOutPath $TEMP
188
  File /oname=spltmp.bmp "hrp_splash.bmp"
189
  advsplash::show 1500 600 250 -1 $TEMP\spltmp
190
  Pop $0
191
  Delete $TEMP\spltmp.bmp
192
 
193
  StrCpy $1 ${SEC04} ; Group 1 - Option 1 is selected by default
194
 
195
FunctionEnd
196
 
197
Section -AdditionalIcons
198
  !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
199
  WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITE}"
200
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\HRP Website.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
201
  CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk" "$INSTDIR\uninst.exe"
202
  !insertmacro MUI_STARTMENU_WRITE_END
203
SectionEnd
204
 
205
Section -Post
206
  WriteUninstaller "$INSTDIR\uninst.exe"
207
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\eduke32.exe"
208
  WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "Path" "$INSTDIR"
209
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
210
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
211
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
212
  WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
213
SectionEnd
214
 
215
; Section descriptions
216
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
217
  !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."
218
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "The high resoltution textures and models."
219
  !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."
220
  !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."
221
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "A pack of high quality replacements for the games music."
222
  !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "A game enhancement mod with bug fixes and (mostly optional) new features."
223
!insertmacro MUI_FUNCTION_DESCRIPTION_END
224
 
225
Function un.onUninstSuccess
226
  HideWindow
227
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
228
FunctionEnd
229
 
230
Function un.onInit
231
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
232
  Abort
233
FunctionEnd
234
 
235
Section Uninstall
236
  !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
237
  Delete "$INSTDIR\${PRODUCT_NAME}.url"
238
  Delete "$INSTDIR\uninst.exe"
239
;eduke32 files
240
  Delete "$INSTDIR\eduke32.exe"
241
  Delete "$INSTDIR\mapster32.exe"
242
  Delete "$INSTDIR\m32help.hlp"
243
  Delete "$INSTDIR\NAMES.H"
244
  Delete "$INSTDIR\tiles.cfg"
245
 
246
;hrp content
247
  Delete "$INSTDIR\hrp_readme.txt"
248
  Delete "$INSTDIR\hrp_art_license.txt"
249
  Delete "$INSTDIR\autoload\duke3d_hrp.zip"
250
 
251
;music content
252
  Delete "$INSTDIR\autoload\eduke32_mus.zip"
253
 
254
;duke plus
255
   Delete "$INSTDIR\DPEFFECTS.html"
256
   Delete "$INSTDIR\dukeplus.bat"
257
   Delete "$INSTDIR\DukePlus_Manual.html"
258
   Delete "$INSTDIR\mapster.bat"
259
 
260
   Delete "$INSTDIR\DukePlus\dpmaps.zip"
261
   Delete "$INSTDIR\DukePlus\dukeplus.def"
262
   Delete "$INSTDIR\DukePlus\DUKEPLUS_RESOURCES.zip"
263
   Delete "$INSTDIR\DukePlus\EDUKE.CON"
264
   Delete "$INSTDIR\DukePlus\tiles005.art"
265
   Delete "$INSTDIR\DukePlus\tiles024.art"
266
 
267
   Delete "$INSTDIR\DukePlus\dpcons\DEFSPLUS.CON"
268
   Delete "$INSTDIR\DukePlus\dpcons\DUKEPLUS.CON"
269
   Delete "$INSTDIR\DukePlus\dpcons\HUDPLUS.CON"
270
   Delete "$INSTDIR\DukePlus\dpcons\LIGHTS.CON"
271
   Delete "$INSTDIR\DukePlus\dpcons\PLAYERPLUS.CON"
272
   Delete "$INSTDIR\DukePlus\dpcons\USERPLUS.CON"
273
 
274
   Delete "$INSTDIR\DukePlus\*.log"
275
 
276
   IfFileExists "$INSTDIR\DukePlus\*.cfg" 0 SkipDnPlusCfg
277
   MessageBox MB_YESNO "Do you want to remove Duke Plus configuration files? These files contain the configuration of the Duke Plus mod." IDNO SkipDnPlusCfg
278
     Delete "$INSTDIR\DukePlus\*.cfg"
279
   SkipDnPlusCfg:
280
 
281
   IfFileExists "$INSTDIR\DukePlus\*.sav" 0 SkipDnPlusSav
282
   MessageBox MB_YESNO "Do you want to remove your saved Duke Plus games?" IDNO SkipDnPlusSav
283
     Delete "$INSTDIR\DukePlus\*.sav"
284
   SkipDnPlusSav:
285
 
286
   IfFileExists "$INSTDIR\DukePlus\*.dmo" 0 SkipDnPlusDmo
287
   MessageBox MB_YESNO "Do you want to remove your Duke Plus demo recordings?" IDNO SkipDnPlusDmo
288
     Delete "$INSTDIR\DukePlus\*.dmo"
289
   SkipDnPlusDmo:
290
 
291
 
292
;datainst
293
  Delete "$INSTDIR\datainst.exe"
294
 
295
;cahce files
296
  Delete "$INSTDIR\textures"
297
  Delete "$INSTDIR\*.cache"
298
  Delete "$INSTDIR\DukePlus\textures"
299
  Delete "$INSTDIR\DukePlus\*.cache"
300
 
301
; shortcuts
302
  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall"
303
  Delete "$SMPROGRAMS\$ICONS_GROUP\HRP Website"
304
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Nukem 3D (EDuke32)"
305
  Delete "$SMPROGRAMS\$ICONS_GROUP\Mapster32"
306
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Plus"
307
  Delete "$SMPROGRAMS\$ICONS_GROUP\Setup video audio and controls"
308
  Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall.lnk"
309
  Delete "$SMPROGRAMS\$ICONS_GROUP\HRP Website.lnk"
310
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Nuke.lnkm 3D (EDuke32).lnk"
311
  Delete "$SMPROGRAMS\$ICONS_GROUP\Mapster32"
312
  Delete "$SMPROGRAMS\$ICONS_GROUP\Duke Plus.lnk"
313
  Delete "$SMPROGRAMS\$ICONS_GROUP\Setup video audio and controls.lnk"
314
 
315
;logfiles
316
  Delete "$INSTDIR\*.log"
317
 
318
;folders
319
  SetOutPath $TEMP
320
  RMDir "$SMPROGRAMS\$ICONS_GROUP"
321
  RMDir "$INSTDIR\autoload"
322
  RMDir "$INSTDIR\autoload"
323
  RMDir "$INSTDIR\texcache"
324
  RMDir "$INSTDIR\DukePlus\dpcons"
325
  RMDir "$INSTDIR\DukePlus"
326
  RMDir "$INSTDIR"
327
 
328
  IfFileExists "$INSTDIR\duke3d.grp" 0 SkipGrpUn
329
  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
330
    Delete "$INSTDIR\duke3d.grp"
331
  SkipGrpUn:
332
 
333
  IfFileExists "$INSTDIR\*.cfg" 0 SkipCfgUn
334
  MessageBox MB_YESNO "Do you want to remove eDuke32 configuration files? These files contain the configuration of eDuke32 and Mapster32." IDNO SkipCfgUn
335
    Delete "$INSTDIR\duke3d.cfg"
336
  SkipCfgUn:
337
 
338
  IfFileExists "$INSTDIR\*.sav" 0 SkipSavUn
339
  MessageBox MB_YESNO "Do you want to remove your saved games?" IDNO SkipSavUn
340
    Delete "$INSTDIR\*.sav"
341
  SkipSavUn:
342
 
343
  IfFileExists "$INSTDIR\*.dmo" 0 SkipDmoUn
344
  MessageBox MB_YESNO "Do you want to remove your demo recordings?" IDNO SkipDmoUn
345
    Delete "$INSTDIR\*.dmo"
346
  SkipDmoUn:
347
 
348
  DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
349
  DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
350
  SetAutoClose true
257 parkar 351
SectionEnd