Rev 34 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
33 | h266 | 1 | @echo off |
2 | color 0C |
||
3 | setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION |
||
4 | pushd "%~dp0" |
||
5 | set startdir=%cd% |
||
6 | |||
7 | :restart |
||
8 | title Duke It Out In D.C. Launcher |
||
9 | if "%editor%"=="1" title Duke It Out In D.C. Editor Launcher |
||
10 | |||
11 | set exedir=%startdir% |
||
12 | |||
13 | set exename=eduke32 |
||
14 | set exeproper=EDuke32 |
||
15 | set action=playing |
||
16 | |||
17 | if "%editor%"=="1" ( |
||
18 | set exename=mapster32 |
||
19 | set exeproper=Mapster32 |
||
20 | set action=editing |
||
21 | ) |
||
22 | |||
23 | :title |
||
24 | echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» |
||
25 | echo º Duke It Out In D.C. º |
||
26 | echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ |
||
27 | echo. |
||
28 | echo. |
||
29 | echo. |
||
30 | echo You are %action% Sunstorm Interactive's Duke It Out In D.C. |
||
31 | echo. |
||
32 | |||
33 | if "%xxx%"=="1" echo Using XXX mode. |
||
34 | if "%dp%"=="1" echo Using Duke Plus by DeeperThought. |
||
35 | if "%debug%"=="1" echo Using debug mode. |
||
36 | |||
37 | if "%debug%"=="1" echo DEBUG: Command Line Input: %* |
||
38 | |||
39 | :recheck |
||
40 | if not exist %exename%.exe goto execheck |
||
41 | :execheck_done |
||
42 | set exedir=%cd% |
||
43 | if "%debug%"=="1" echo DEBUG: %exeproper% Directory: "%exedir%" |
||
44 | |||
45 | :: if not exist dc_hrp\ goto nodir |
||
46 | if not exist duke3d.grp echo Warning: You don't have Duke3D.grp in your directory. |
||
47 | |||
48 | set sha1sum=%startdir%\utils\windows\win32\sha1sum.exe |
||
49 | set kextract=%startdir%\utils\windows\win32\kextract.exe |
||
50 | if "%debug%"=="1" set kextract=%startdir%\utils\windows\win32\kextract.debug.exe |
||
51 | |||
52 | if exist dukedc.grp ren dukedc.grp dukedc.grp |
||
53 | if "%dcgrpname%"=="" set dcgrpname=dukedc.grp |
||
54 | if exist "%dcgrpname%" goto dcgrp_found |
||
55 | if not exist dukedc.grp if exist DUKEDCPP.GRP ren DUKEDCPP.GRP dukedc.grp |
||
56 | if not exist dukedc.grp if exist DUKEDC13.GRP ren DUKEDC13.GRP dukedc.grp |
||
57 | if not exist dukedc.grp if exist DC.GRP ren DC.GRP dukedc.grp |
||
58 | if not exist dukedc.grp goto nodcgrp |
||
59 | |||
60 | :dcgrp_found |
||
61 | call :grpchecksum |
||
62 | |||
63 | :nodcgrp_return |
||
64 | chdir /d "%exedir%" |
||
65 | echo. |
||
66 | echo. |
||
67 | echo. |
||
68 | echo. |
||
69 | echo. |
||
70 | echo. |
||
71 | echo. |
||
72 | echo. |
||
73 | echo. |
||
74 | echo. |
||
75 | echo. |
||
76 | |||
77 | |||
78 | :init |
||
79 | pause |
||
80 | echo. |
||
81 | goto check |
||
82 | |||
83 | :check |
||
84 | |||
85 | echo. |
||
86 | echo Launching Duke Nukem 3D . . . |
||
87 | echo Thanks for %action%! |
||
88 | echo. |
||
89 | |||
90 | if exist duke3d.def ren duke3d.def duke3d_dcbak.def |
||
91 | |||
92 | if exist duke3d_dcbak.def echo duke3d.def has been renamed to duke3d_dcbak.def to allow the add-on to operate. |
||
93 | |||
94 | :arguments |
||
95 | set args= |
||
96 | if exist "%exedir%\HRP\" set args=%args% -jHRP |
||
97 | if exist "%exedir%\polymer_hrp\" set args=%args% -jpolymer_hrp |
||
98 | if exist "%exedir%\duke3d_voxel.zip" set args=%args% -gduke3d_voxel.zip |
||
99 | if exist "%exedir%\duke3d_hrp.zip" set args=%args% -gduke3d_hrp.zip |
||
100 | if exist "%exedir%\hrp_update.zip" set args=%args% -ghrp_update.zip |
||
101 | if exist "%exedir%\maphacks.zip" set args=%args% -gmaphacks.zip |
||
102 | if exist "%exedir%\eduke32_mus.zip" set args=%args% -geduke32_mus.zip |
||
103 | set args=%args% -gdukedc.grp -mx dc_user.con |
||
104 | if exist "%exedir%\dc.def" set args=%args% -hdc.def |
||
105 | if exist "%exedir%\dukedc.def" set args=%args% -hdukedc.def |
||
106 | if exist "%exedir%\dukedc_hrp.zip" set args=%args% -gdukedc_hrp.zip |
||
107 | if exist "%exedir%\dc_hrp\" set args=%args% -jdc_hrp |
||
108 | if "%xxx%"=="1" if exist "%exedir%\xxx_lite.zip" set args=%args% -gxxx_lite.zip |
||
109 | if "%xxx%"=="1" if exist "%exedir%\xxx_lite\" set args=%args% -jxxx_lite |
||
110 | if "%xxx%"=="1" if exist "%exedir%\xxx_pack.zip" set args=%args% -gxxx_pack.zip |
||
111 | if "%xxx%"=="1" if exist "%exedir%\xxx_pack\" set args=%args% -jxxx_pack |
||
112 | set args=%args% %* |
||
113 | if "%dp%"=="1" set args=%args% -jDukePlus |
||
114 | |||
115 | set exe=%exename% |
||
116 | if "%debug%"=="1" set exe=%exename%.debug |
||
117 | |||
118 | if exist %exe%.bat ( |
||
119 | if "%debug%"=="1" echo DEBUG: Final Command Line: call %exe%.bat %args% |
||
120 | call %exe%.bat %args% |
||
121 | ) else ( |
||
122 | if "%debug%"=="1" echo DEBUG: Final Command Line: start %exe%.exe %args% |
||
123 | start %exe%.exe %args% |
||
124 | ) |
||
125 | |||
126 | set svnpath=0 |
||
127 | if "%svnpath%"=="0" if exist "%startdir%\svn\bin\svn.exe" set svnpath=%startdir%\svn\bin |
||
128 | if "%svnpath%"=="0" if exist "%exedir%\svn\bin\svn.exe" set svnpath=%exedir%\svn\bin |
||
129 | if "%svnpath%"=="0" if exist "%ProgramFiles%\SlikSvn\bin\svn.exe" set svnpath=%ProgramFiles%\SlikSvn\bin |
||
130 | if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\SlikSvn\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\SlikSvn\bin |
||
131 | if "%svnpath%"=="0" if exist "%ProgramFiles%\Subversion\bin\svn.exe" set svnpath=%ProgramFiles%\Subversion\bin |
||
132 | if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\Subversion\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\Subversion\bin |
||
133 | if "%svnpath%"=="0" if exist "%ProgramFiles%\TortoiseSVN\bin\svn.exe" set svnpath=%ProgramFiles%\TortoiseSVN\bin |
||
134 | if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\TortoiseSVN\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\TortoiseSVN\bin |
||
135 | if "%svnpath%"=="0" for %%S in (svn.exe) do if exist "%%~dp$PATH:S" set svnpath=%%~dp$PATH:S |
||
136 | |||
137 | if exist "%exedir%\dc_hrp\" ( |
||
138 | chdir /d "%exedir%\dc_hrp\" |
||
139 | if not "%svnpath%"=="0" call :svn_action |
||
140 | ) |
||
141 | |||
142 | goto end |
||
143 | |||
144 | :svn_action |
||
145 | set PATH=%PATH%;%svnpath% |
||
146 | for /f "delims=" %%a in ('svnversion.exe .') do @set oldrev=%%a |
||
147 | if "%oldrev%"=="exported" goto :eof |
||
148 | if "%oldrev%"=="Unversioned directory" goto :eof |
||
149 | "svn.exe" update |
||
150 | for /f "delims=" %%a in ('svnversion.exe .') do @set rev=%%a |
||
151 | if %rev% EQU %oldrev% goto :eof |
||
152 | set /a oldrev=%oldrev% + 1 |
||
153 | echo. |
||
154 | "svn.exe" log -r %oldrev%:%rev% |
||
155 | echo. |
||
156 | pause |
||
157 | goto :eof |
||
158 | |||
159 | :nodcgrp |
||
160 | set megaton=Steam\SteamApps\common\Duke Nukem 3D\gameroot\addons\dukedc.grp |
||
161 | if exist "%ProgramFiles%\%megaton%" copy "%ProgramFiles%\%megaton%" .\ && call :conprotect && goto nodcgrp_done |
||
162 | if exist "%ProgramFiles(x86)%\%megaton%" copy "%ProgramFiles(x86)%\%megaton%" .\ && call :conprotect && goto nodcgrp_done |
||
163 | title Duke It Out In D.C. for EDuke32 Installer |
||
164 | color 0C |
||
165 | |||
166 | echo. |
||
167 | echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» |
||
168 | echo º Duke It Out In D.C. for EDuke32 Installer º |
||
169 | echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍͼ |
||
170 | echo ³ By Hendricks266 ³ |
||
171 | echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ |
||
172 | echo. |
||
173 | echo This batch file extracts the contents of DUKEDCPP.SSI or DUKEDC13.SSI and makes |
||
174 | echo it into a group file, DUKEDC.GRP. |
||
175 | echo. |
||
176 | |||
177 | set kgroup=%startdir%\utils\windows\win32\kgroup.exe |
||
178 | if "%debug%"=="1" set kgroup=%startdir%\utils\windows\win32\kgroup.debug.exe |
||
179 | set unpackssi=%startdir%\utils\windows\win32\unpackssi.exe |
||
180 | if "%debug%"=="1" set unpackssi=%startdir%\utils\windows\win32\unpackssi.debug.exe |
||
181 | |||
182 | pause |
||
183 | :nodcgrp_top |
||
184 | echo. |
||
185 | if not exist DUKEDCPP.SSI goto check13 |
||
186 | echo Proceeding with DUKEDCPP.SSI extraction. |
||
187 | mkdir dukedcpp |
||
188 | chdir dukedcpp |
||
189 | "%unpackssi%" ..\DUKEDCPP.SSI |
||
190 | if exist DUKETEAM.ANM ren DUKETEAM.ANM RADLOGO.ANM |
||
191 | if exist USER.CON ren USER.CON USER.BAK |
||
192 | "%kgroup%" dukedc.grp *.* |
||
193 | if exist dukedc.grp move dukedc.grp ..\dukedc.grp |
||
194 | echo DUKEDC.GRP has been added to your directory. |
||
195 | if not exist ..\DUKEDC*.MAP move *.MAP ..\ |
||
196 | chdir .. |
||
197 | rmdir /s /q dukedcpp |
||
198 | echo. |
||
199 | echo. |
||
200 | if not exist DUKEDC13.SSI goto nodcgrp_done |
||
201 | |||
202 | :check13 |
||
203 | if not exist DUKEDC13.SSI goto error |
||
204 | echo Proceeding with DUKEDC13.SSI extraction. |
||
205 | mkdir dukedc13 |
||
206 | chdir dukedc13 |
||
207 | "%unpackssi%" ..\DUKEDC13.SSI |
||
208 | if exist DUKETEAM.ANM ren DUKETEAM.ANM RADLOGO.ANM |
||
209 | if exist USER.CON ren USER.CON USER.BAK |
||
210 | "%kgroup%" dukedc.grp *.* |
||
211 | if exist ..\dukedc.grp ( |
||
212 | if exist dukedc.grp ( |
||
213 | move dukedc.grp ..\dukedc13.grp |
||
214 | echo DUKEDC13.GRP has been added to your directory. |
||
215 | ) ) else ( |
||
216 | if exist dukedc.grp ( |
||
217 | move dukedc.grp ..\dukedc.grp |
||
218 | echo DUKEDC.GRP has been added to your directory. |
||
219 | ) ) |
||
220 | if not exist ..\DUKEDC*.MAP move *.MAP ..\ |
||
221 | chdir .. |
||
222 | rmdir /s /q dukedc13 |
||
223 | echo. |
||
224 | echo. |
||
225 | goto nodcgrp_done |
||
226 | |||
227 | :nodcgrp_done |
||
228 | if exist dukedc.grp ( |
||
229 | type DCINTRO.TXT |
||
230 | echo. |
||
231 | echo. |
||
232 | echo. |
||
233 | echo Duke It Out In D.C. installed! |
||
234 | echo. |
||
235 | pause |
||
236 | call :grpchecksum |
||
237 | call :grpchecksum_results |
||
238 | goto nodcgrp_return |
||
239 | ) |
||
240 | if not exist dukedc.grp ( |
||
241 | echo Installation Error! |
||
242 | echo Contact Hendricks266 for help. |
||
243 | echo. |
||
244 | pause |
||
245 | goto end |
||
246 | ) |
||
247 | |||
248 | :conprotect |
||
249 | pushd "%exedir%" |
||
250 | if not exist GAME.CON "%kextract%" DUKE3D.GRP GAME.CON |
||
251 | if not exist DEFS.CON "%kextract%" DUKE3D.GRP DEFS.CON |
||
252 | if not exist USER.CON "%kextract%" DUKE3D.GRP USER.CON |
||
253 | popd |
||
254 | goto :eof |
||
255 | |||
256 | :grpchecksum |
||
257 | if not exist "%sha1sum%" ( |
||
258 | echo "%sha1sum%" not found. |
||
259 | goto :eof |
||
260 | ) |
||
261 | pushd . |
||
262 | if exist "%startdir%\%dcgrpname%" chdir /d %startdir% |
||
263 | if exist "%exedir%\%dcgrpname%" chdir /d %exedir% |
||
264 | echo 1b66c3ad9a65556044946dd1ca97a839fcfedc3b *%dcgrpname% | "%sha1sum%" --status --check - |
||
265 | if "%ERRORLEVEL%"=="0" set version=megaton && call :conprotect && popd && goto :eof |
||
266 | if "%ERRORLEVEL%"=="1" set version=unknown |
||
267 | popd |
||
268 | goto :eof |
||
269 | |||
270 | :grpchecksum_results |
||
271 | if "%version%"=="megaton" echo DUKEDC.GRP (Megaton Edition) checksum verified. |
||
272 | :: if "%version%"=="unknown" echo DUKEDC.GRP checksum does not match any known copies because one was never distributed until the Megaton Edition. |
||
273 | echo. |
||
274 | goto :eof |
||
275 | |||
276 | :error |
||
277 | echo. |
||
278 | echo You do not have DUKEDCPP.SSI or DUKEDC13.SSI in this directory. |
||
279 | :retry |
||
280 | echo. |
||
281 | set cddrive= |
||
282 | set /p cddrive=What is the drive letter that your Duke D.C. CD is in? |
||
283 | echo. |
||
284 | if not '%cddrive%'=='' set cddrive=%cddrive:~0,1% |
||
285 | if '%cddrive%'=='' goto cdno |
||
286 | if not exist %cddrive%:\ goto cdno |
||
287 | if not exist %cddrive%:\* goto cdno |
||
288 | if exist %cddrive%:\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DUKEDC\*.SSI .\ && goto nodcgrp_top |
||
289 | if exist %cddrive%:\DUKEDC\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DUKEDC\DUKEDC\*.SSI .\ && goto nodcgrp_top |
||
290 | if exist %cddrive%:\DC\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DC\DUKEDC\*.SSI .\ && goto nodcgrp_top |
||
291 | goto cdwrong |
||
292 | |||
293 | :cdno |
||
294 | echo '%cddrive%' is not valid. Please try again. |
||
295 | goto retry |
||
296 | |||
297 | :cdwrong |
||
298 | echo '%cddrive%' is not the correct disc. Please try again. |
||
299 | goto retry |
||
300 | |||
301 | :execheck |
||
302 | if exist %exename%.bat goto execheck_done |
||
303 | if exist %exename%.exe goto recheck |
||
304 | set prevdir=%cd% |
||
305 | if not "%cd%"=="%cd:~0,3%" chdir .. |
||
306 | if not "%cd%"=="%prevdir%" goto execheck |
||
307 | echo Warning: You don't have %exeproper% in your directory. |
||
308 | chdir /d "%startdir%" |
||
309 | goto execheck_done |
||
310 | |||
311 | :end |
||
312 | if "%debug%"=="1" echo. |
||
313 | if "%debug%"=="1" pause |
||
314 | echo. |
||
315 | popd |
||
316 | endlocal |
||
317 | title %ComSpec% |
||
318 | color 07 |