Subversion Repositories dc_hrp

Rev

Rev 33 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  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. set oldrev=%oldrev:M=%
  152. set oldrev=%oldrev:S=%
  153. set oldrev=%oldrev:P=%
  154. set rev=%rev:M=%
  155. set rev=%rev:S=%
  156. set rev=%rev:P=%
  157. if %rev% EQU %oldrev% goto :eof
  158. set /a oldrev=%oldrev% + 1
  159. echo.
  160. "svn.exe" log -r %oldrev%:%rev%
  161. echo.
  162. pause
  163. goto :eof
  164.  
  165. :nodcgrp
  166. set megaton=Steam\SteamApps\common\Duke Nukem 3D\gameroot\addons\dukedc.grp
  167. if exist "%ProgramFiles%\%megaton%" copy "%ProgramFiles%\%megaton%" .\ && call :conprotect && goto nodcgrp_done
  168. if exist "%ProgramFiles(x86)%\%megaton%" copy "%ProgramFiles(x86)%\%megaton%" .\ && call :conprotect && goto nodcgrp_done
  169. title Duke It Out In D.C. for EDuke32 Installer
  170. color 0C
  171.  
  172. echo.
  173. echo                   ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  174. echo                   º Duke It Out In D.C. for EDuke32 Installer º
  175. echo                   ÈÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍͼ
  176. echo                                ³ By Hendricks266 ³
  177. echo                                ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
  178. echo.
  179. echo This batch file extracts the contents of DUKEDCPP.SSI or DUKEDC13.SSI and makes
  180. echo it into a group file, DUKEDC.GRP.
  181. echo.
  182.  
  183. set kgroup=%startdir%\utils\windows\win32\kgroup.exe
  184. if "%debug%"=="1" set kgroup=%startdir%\utils\windows\win32\kgroup.debug.exe
  185. set unpackssi=%startdir%\utils\windows\win32\unpackssi.exe
  186. if "%debug%"=="1" set unpackssi=%startdir%\utils\windows\win32\unpackssi.debug.exe
  187.  
  188. pause
  189. :nodcgrp_top
  190. echo.
  191. if not exist DUKEDCPP.SSI goto check13
  192. echo Proceeding with DUKEDCPP.SSI extraction.
  193. mkdir dukedcpp
  194. chdir dukedcpp
  195. "%unpackssi%" ..\DUKEDCPP.SSI
  196. if exist DUKETEAM.ANM ren DUKETEAM.ANM RADLOGO.ANM
  197. if exist USER.CON ren USER.CON USER.BAK
  198. "%kgroup%" dukedc.grp *.*
  199. if exist dukedc.grp move dukedc.grp ..\dukedc.grp
  200. echo DUKEDC.GRP has been added to your directory.
  201. if not exist ..\DUKEDC*.MAP move *.MAP ..\
  202. chdir ..
  203. rmdir /s /q dukedcpp
  204. echo.
  205. echo.
  206. if not exist DUKEDC13.SSI goto nodcgrp_done
  207.  
  208. :check13
  209. if not exist DUKEDC13.SSI goto error
  210. echo Proceeding with DUKEDC13.SSI extraction.
  211. mkdir dukedc13
  212. chdir dukedc13
  213. "%unpackssi%" ..\DUKEDC13.SSI
  214. if exist DUKETEAM.ANM ren DUKETEAM.ANM RADLOGO.ANM
  215. if exist USER.CON ren USER.CON USER.BAK
  216. "%kgroup%" dukedc.grp *.*
  217. if exist ..\dukedc.grp (
  218. if exist dukedc.grp (
  219. move dukedc.grp ..\dukedc13.grp
  220. echo DUKEDC13.GRP has been added to your directory.
  221. ) ) else (
  222. if exist dukedc.grp (
  223. move dukedc.grp ..\dukedc.grp
  224. echo DUKEDC.GRP has been added to your directory.
  225. ) )
  226. if not exist ..\DUKEDC*.MAP move *.MAP ..\
  227. chdir ..
  228. rmdir /s /q dukedc13
  229. echo.
  230. echo.
  231. goto nodcgrp_done
  232.  
  233. :nodcgrp_done
  234. if exist dukedc.grp (
  235. type DCINTRO.TXT
  236. echo.
  237. echo.
  238. echo.
  239. echo Duke It Out In D.C. installed!
  240. echo.
  241. pause
  242. call :grpchecksum
  243. call :grpchecksum_results
  244. goto nodcgrp_return
  245. )
  246. if not exist dukedc.grp (
  247. echo Installation Error!
  248. echo Contact Hendricks266 for help.
  249. echo.
  250. pause
  251. goto end
  252. )
  253.  
  254. :conprotect
  255. pushd "%exedir%"
  256. if not exist GAME.CON "%kextract%" DUKE3D.GRP GAME.CON
  257. if not exist DEFS.CON "%kextract%" DUKE3D.GRP DEFS.CON
  258. if not exist USER.CON "%kextract%" DUKE3D.GRP USER.CON
  259. popd
  260. goto :eof
  261.  
  262. :grpchecksum
  263. if not exist "%sha1sum%" (
  264. echo "%sha1sum%" not found.
  265. goto :eof
  266. )
  267. pushd .
  268. if exist "%startdir%\%dcgrpname%" chdir /d %startdir%
  269. if exist "%exedir%\%dcgrpname%" chdir /d %exedir%
  270. echo 1b66c3ad9a65556044946dd1ca97a839fcfedc3b *%dcgrpname% | "%sha1sum%" --status --check -
  271. if "%ERRORLEVEL%"=="0" set version=megaton && call :conprotect && popd && goto :eof
  272. if "%ERRORLEVEL%"=="1" set version=unknown
  273. popd
  274. goto :eof
  275.  
  276. :grpchecksum_results
  277. if "%version%"=="megaton" echo DUKEDC.GRP (Megaton Edition) checksum verified.
  278. :: if "%version%"=="unknown" echo DUKEDC.GRP checksum does not match any known copies because one was never distributed until the Megaton Edition.
  279. echo.
  280. goto :eof
  281.  
  282. :error
  283. echo.
  284. echo You do not have DUKEDCPP.SSI or DUKEDC13.SSI in this directory.
  285. :retry
  286. echo.
  287. set cddrive=
  288. set /p cddrive=What is the drive letter that your Duke D.C. CD is in?
  289. echo.
  290. if not '%cddrive%'=='' set cddrive=%cddrive:~0,1%
  291. if '%cddrive%'=='' goto cdno
  292. if not exist %cddrive%:\ goto cdno
  293. if not exist %cddrive%:\* goto cdno
  294. if exist %cddrive%:\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DUKEDC\*.SSI .\ && goto nodcgrp_top
  295. if exist %cddrive%:\DUKEDC\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DUKEDC\DUKEDC\*.SSI .\ && goto nodcgrp_top
  296. if exist %cddrive%:\DC\DUKEDC\DUKEDCPP.SSI copy %cddrive%:\DC\DUKEDC\*.SSI .\ && goto nodcgrp_top
  297. goto cdwrong
  298.  
  299. :cdno
  300. echo '%cddrive%' is not valid.  Please try again.
  301. goto retry
  302.  
  303. :cdwrong
  304. echo '%cddrive%' is not the correct disc.  Please try again.
  305. goto retry
  306.  
  307. :execheck
  308. if exist %exename%.bat goto execheck_done
  309. if exist %exename%.exe goto recheck
  310. set prevdir=%cd%
  311. if not "%cd%"=="%cd:~0,3%" chdir ..
  312. if not "%cd%"=="%prevdir%" goto execheck
  313. echo Warning: You don't have %exeproper% in your directory.
  314. chdir /d "%startdir%"
  315. goto execheck_done
  316.  
  317. :end
  318. if "%debug%"=="1" echo.
  319. if "%debug%"=="1" pause
  320. echo.
  321. popd
  322. endlocal
  323. title %ComSpec%
  324. color 07
  325.