Subversion Repositories vaca_plus

Rev

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

@echo off
color 0C
setlocal ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
pushd "%~dp0"
set startdir=%cd%

:restart
title Duke Caribbean: Life's A Beach Plus Launcher
if "%editor%"=="1" title Duke Caribbean: Life's A Beach Plus Editor Launcher

set exedir=%startdir%
set addondir=%startdir%
set addonhrpdir=%startdir%

set exename=eduke32
set exeproper=EDuke32
set action=playing

if "%editor%"=="1" (
set exename=mapster32
set exeproper=Mapster32
set action=editing
)

set addonver=r004

:title
echo                     ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo                     º Duke Caribbean: Life's A Beach Plus º
echo                     ÈÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍͼ
echo                               ³ By Hendricks266 ³
echo                               ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
echo.
echo You are %action% Sunstorm Interactive's Duke Caribbean: Life's A Beach with the
echo various enhancements of Duke Caribbean: Life's A Beach Plus, maintained by
echo Hendricks266.
echo.

if "%xxx%"=="1" echo Using XXX mode.
if "%dp%"=="1" echo Using Duke Plus by DeeperThought.
if "%debug%"=="1" echo Using debug mode.

if "%debug%"=="1" echo DEBUG: Command Line Input: %*

:recheck
if not exist %exename%.exe goto execheck
:execheck_done
set exedir=%cd%
if "%debug%"=="1" echo DEBUG: %exeproper% Directory: "%exedir%"

if not exist vaca_plus\ goto nodir
if not exist duke3d.grp echo Warning: You don't have Duke3D.grp in your directory.

if exist vacation\ set addonhrpdir=%cd%
:addondircheck
if exist VACATION.PRG ren VACATION.PRG vacation.grp
chdir vaca_plus
set addondir=%cd%
if exist vacation\ set addonhrpdir=%cd%
if exist vaca_plus\ goto addondircheck
if "%debug%"=="1" echo DEBUG: Vaca+ Directory: "%addondir%".
if "%debug%"=="1" echo DEBUG: VacaHRP Directory: "%addonhrpdir%".

set kextract=%addondir%\utils\windows\win32\kextract.exe
if "%debug%"=="1" set kextract=%addondir%\utils\windows\win32\kextract.debug.exe
set kgroup=%addondir%\utils\windows\win32\kgroup.exe
if "%debug%"=="1" set kgroup=%addondir%\utils\windows\win32\kgroup.debug.exe
set unpackssi=%addondir%\utils\windows\win32\unpackssi.exe
if "%debug%"=="1" set unpackssi=%addondir%\utils\windows\win32\unpackssi.debug.exe
set bspatch=%addondir%\utils\windows\win32\bspatch.exe
set sha1sum=%addondir%\utils\windows\win32\sha1sum.exe

if "%vacagrpname%"=="" set vacagrpname=vacation.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%exedir%\vaca15.grp" set vacagrpname=vaca15.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%addondir%\vaca15.grp" set vacagrpname=vaca15.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%exedir%\vacapp.grp" set vacagrpname=vacapp.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%addondir%\vacapp.grp" set vacagrpname=vacapp.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%exedir%\vaca13.grp" set vacagrpname=vaca13.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%addondir%\vaca13.grp" set vacagrpname=vaca13.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%exedir%\vacation13.grp" set vacagrpname=vacation13.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" if exist "%addondir%\vacation13.grp" set vacagrpname=vacation13.grp
if not exist "%exedir%\%vacagrpname%" if not exist "%addondir%\%vacagrpname%" goto novacagrp

if exist vacation.grp ren vacation.grp vacation.grp
call :grpchecksum
:novacagrp_return
if not "%version%"=="demo" (
if not exist vaca1.map goto mapextract
if not exist vaca2.map goto mapextract
if not exist vaca3.map goto mapextract
if not exist vaca4.map goto mapextract
if not exist vaca5.map goto mapextract
if not exist vaca6.map goto mapextract
if not exist vaca7.map goto mapextract
if not exist vacasl.map goto mapextract
if not exist vacadm1.map goto mapextract
if not exist vacadm2.map goto mapextract
if not exist vacadm3.map goto mapextract
if not exist vacadm4.map goto mapextract
if not exist vacaflag_%addonver%.h266 goto updateextract
)
chdir /d "%exedir%"
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.

:init
pause
echo.
goto check

:check

echo.
echo Launching Duke Nukem 3D . . .
echo Thanks for %action%!
echo.

if "%editor%"=="1" (
type "%exedir%\names.h" > "%exedir%\VacaNames.h"
echo. >> "%exedir%\VacaNames.h"
type "%addondir%\VacaNames.def" >> "%exedir%\VacaNames.h"
)

:arguments
set args=
if exist "%exedir%\HRP\" set args=%args% -j HRP
if exist "%exedir%\polymer_hrp\" set args=%args% -j polymer_hrp
if exist "%exedir%\duke3d_voxel.zip" set args=%args% -g duke3d_voxel.zip
if exist "%exedir%\duke3d_hrp.zip" set args=%args% -g duke3d_hrp.zip
if exist "%exedir%\hrp_update.zip" set args=%args% -g hrp_update.zip
if exist "%exedir%\maphacks.zip" set args=%args% -g maphacks.zip
if exist "%exedir%\eduke32_mus.zip" set args=%args% -g eduke32_mus.zip
if exist "%addondir%" if not "%addondir%"=="%exedir%" set args=%args% -j "%addondir:\=/%"
if exist "%addonhrpdir%" if not "%addonhrpdir%"=="%exedir%" if not "%addonhrpdir%"=="%addondir%" set args=%args% -j "%addonhrpdir:\=/%"
set args=%args% -g %vacagrpname% -h vacation.def -x VacaEDuke.con
if "%editor%"=="1" set args=%args% -namesfile VacaNames.h
if "%dp%"=="1" set args=%args% -h vaca_dp.def -x VacaDP.con
if "%xxx%"=="1" if exist "%exedir%\xxx_lite.zip" set args=%args% -g xxx_lite.zip
if "%xxx%"=="1" if exist "%exedir%\xxx_lite\" set args=%args% -j xxx_lite
if "%xxx%"=="1" if exist "%exedir%\xxx_pack.zip" set args=%args% -g xxx_pack.zip
if "%xxx%"=="1" if exist "%exedir%\xxx_pack\" set args=%args% -j xxx_pack
if "%xxx%"=="1" set args=%args% -h vaca_xxx.def
if "%xxx%"=="1" if "%dp%"=="1" set args=%args% -h vaca_dp_xxx.def -x VacaDPXXX.con
set args=%args% %*
if "%dp%"=="1" set args=%args% -j DukePlus

set exe=%exename%
if "%debug%"=="1" set exe=%exename%.debug

if exist %exe%.bat (
if "%debug%"=="1" echo DEBUG: Final Command Line: call %exe%.bat %args%
call %exe%.bat %args%
) else (
if "%debug%"=="1" echo DEBUG: Final Command Line: start %exe%.exe %args%
start %exe%.exe %args%
)

set svnpath=0
if "%svnpath%"=="0" if exist "%startdir%\svn\bin\svn.exe" set svnpath=%startdir%\svn\bin
if "%svnpath%"=="0" if exist "%exedir%\svn\bin\svn.exe" set svnpath=%exedir%\svn\bin
if "%svnpath%"=="0" if exist "%ProgramFiles%\SlikSvn\bin\svn.exe" set svnpath=%ProgramFiles%\SlikSvn\bin
if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\SlikSvn\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\SlikSvn\bin
if "%svnpath%"=="0" if exist "%ProgramFiles%\Subversion\bin\svn.exe" set svnpath=%ProgramFiles%\Subversion\bin
if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\Subversion\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\Subversion\bin
if "%svnpath%"=="0" if exist "%ProgramFiles%\TortoiseSVN\bin\svn.exe" set svnpath=%ProgramFiles%\TortoiseSVN\bin
if "%svnpath%"=="0" if exist "%ProgramFiles(x86)%\TortoiseSVN\bin\svn.exe" set svnpath=%ProgramFiles(x86)%\TortoiseSVN\bin
if "%svnpath%"=="0" for %%S in (svn.exe) do if exist "%%~dp$PATH:S" set svnpath=%%~dp$PATH:S

chdir /d "%addondir%"
if not "%svnpath%"=="0" call :svn_action
chdir /d "%addonhrpdir%"
if not "%svnpath%"=="0" call :svn_action

goto end

:svn_action
set PATH=%PATH%;%svnpath%
for /f "delims=" %%a in ('svnversion.exe .') do @set oldrev=%%a
if "%oldrev%"=="exported" goto :eof
if "%oldrev%"=="Unversioned directory" goto :eof
"svn.exe" update
for /f "delims=" %%a in ('svnversion.exe .') do @set rev=%%a
set oldrev=%oldrev:M=%
set oldrev=%oldrev:S=%
set oldrev=%oldrev:P=%
set rev=%rev:M=%
set rev=%rev:S=%
set rev=%rev:P=%
if %rev% EQU %oldrev% goto :eof
set /a oldrev=%oldrev% + 1
echo.
"svn.exe" log -r %oldrev%:%rev%
echo.
pause
goto :eof

:novacagrp
set megaton=Steam\SteamApps\common\Duke Nukem 3D\gameroot\addons\vacation.grp
if exist "%ProgramFiles%\%megaton%" copy "%ProgramFiles%\%megaton%" .\ && call :conprotect && goto novacagrp_done
if exist "%ProgramFiles(x86)%\%megaton%" copy "%ProgramFiles(x86)%\%megaton%" .\ && call :conprotect && goto novacagrp_done
echo.
echo Error: You don't have VACATION.GRP in your directory.
echo.
goto ssicheck
:retry
echo.
set cddrive=
set /p cddrive=What is the drive letter that your Caribbean CD is in? 
echo.
if not '%cddrive%'=='' set cddrive=%cddrive:~0,1%
if '%cddrive%'=='' goto cdno
if not exist %cddrive%:\ goto cdno
if not exist %cddrive%:\* goto cdno
if exist %cddrive%:\VACATION\VACA13.SSI copy %cddrive%:\VACATION\*.SSI .\ && goto ssicheck
if exist %cddrive%:\VACATION\VACATION\VACA13.SSI copy %cddrive%:\VACATION\VACATION\*.SSI .\ && goto ssicheck
if exist %cddrive%:\CARIBBEA\VACA13.SSI copy %cddrive%:\CARIBBEA\VACATION\*.SSI .\ && goto ssicheck
if exist %cddrive%:\CARIBBEAN\VACA13.SSI copy %cddrive%:\CARIBBEAN\VACATION\*.SSI .\ && goto ssicheck
goto cdwrong

:cdno
echo '%cddrive%' is not valid.  Please try again.
goto retry

:cdwrong
echo '%cddrive%' is not the correct disc.  Please try again.
goto retry

:ssicheck
if exist VACA15.SSI goto ssi1
if exist VACAPP.SSI goto ssi2
if exist VACA13.SSI goto ssi3
echo You don't have the SSI files in your directory.
goto retry

:ssi1
echo You do have the Caribbean SSI file in this directory, but it has not been
echo extracted.  It will now be unpacked.
echo.
pause
mkdir vaca15ssi
chdir vaca15ssi
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
"%unpackssi%" ..\VACA15.SSI
if exist VACATION.PRG move /y VACATION.PRG ..\vacation.grp
chdir ..
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
if exist vacation.grp (
rmdir /s /q vaca15ssi
goto novacagrp_done
)
if not exist vacation.grp (
echo Installation Error!
echo Contact Hendricks266 for help.
echo.
pause
goto end
)

:ssi2
echo You do have the Caribbean SSI file in this directory, but it has not been
echo extracted.  It will now be unpacked.
echo.
pause
mkdir vacappssi
chdir vacappssi
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
"%unpackssi%" ..\VACAPP.SSI
if exist VACATION.PRG move /y VACATION.PRG ..\vacation.grp
chdir ..
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
if exist vacation.grp (
rmdir /s /q vacappssi
goto novacagrp_done
)
if not exist vacation.grp (
echo Installation Error!
echo Contact Hendricks266 for help.
echo.
pause
goto end
)

:ssi3
echo You do have the Caribbean SSI file in this directory, but it has not been
echo extracted.  It will now be unpacked.
echo.
pause
mkdir vaca13ssi
chdir vaca13ssi
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
"%unpackssi%" ..\VACA13.SSI
ren *.TRA *.ART
ren *.PCS *.SCP
ren VACA1.MAP vaca1.map
ren VACA2.MAP vaca2.map
ren VACA3.MAP vaca3.map
ren VACA4.MAP vaca4.map
ren VACA5.MAP vaca5.map
ren VACA6.MAP vaca6.map
ren VACA7.MAP vaca7.map
ren VACASL.MAP vacasl.map
ren VACADM1.MAP vacadm1.map
ren VACADM2.MAP vacadm2.map
ren VACADM3.MAP vacadm3.map
ren VACADM4.MAP vacadm4.map
ren *.NOC *.CON
ren *.DIM *.MID
ren *.MNA *.ANM
ren *.COV *.VOC
ren *.OMD *.DMO
ren GAME.CON VACAGAME.CON
ren USER.CON VACAUSER.CON
ren DEFS.CON VACADEFS.CON
ren DUKETEAM.ANM RADLOGO.ANM
"%kgroup%" vacation.grp *.ART *.SCP *.map *.MID *.ANM *.VOC *.DMO CARIB.EXE
if exist vacation.grp move /y vacation.grp ..\vacation.grp
move /y *.map ..\
chdir ..
if "%debug%"=="1" echo DEBUG: Changing directory to "%cd%".
if exist vacation.grp (
rmdir /s /q vaca13ssi
goto novacagrp_done
)
if not exist vacation.grp (
echo Installation Error!
echo Contact Hendricks266 for help.
echo.
pause
goto end
)

:novacagrp_done
type DVINTRO.TXT
echo.
pause
call :grpchecksum
call :grpchecksum_results
goto novacagrp_return

:grpchecksum
if not exist "%sha1sum%" (
echo "%sha1sum%" not found.
goto :eof
)
pushd .
if exist "%addondir%\%vacagrpname%" chdir /d %addondir%
if exist "%exedir%\%vacagrpname%" chdir /d %exedir%
echo ea0a9a77b9aee6edce76afa19eaea3a810fb2390 *%vacagrpname% | "%sha1sum%" --status --check -
if "%ERRORLEVEL%"=="0" set version=full&& popd && goto :eof
if "%ERRORLEVEL%"=="1" echo 65b8b787616ed637f86cfcaa90de24c8e65b3dcc *%vacagrpname% | "%sha1sum%" --status --check -
if "%ERRORLEVEL%"=="0" set version=megaton&& call :conprotect && popd && goto :eof
if "%ERRORLEVEL%"=="1" set version=unknown
popd
goto :eof

:grpchecksum_results
if "%version%"=="full" echo VACATION.GRP checksum verified.
if "%version%"=="megaton" echo VACATION.GRP (Megaton Edition) checksum verified.
if "%version%"=="unknown" echo VACATION.GRP checksum does not match. You may have a bad copy.
echo.
goto :eof


:mapextract
echo Extracted maps not found or patched. Proceeding to installation.
goto extract

:updateextract
echo Map patch update required. Proceeding to installation.
goto extract

:extract
echo.
echo                                ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo                                º Installation º
echo                                ÈÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
call :grpchecksum
call :grpchecksum_results
if not exist vaca1.patch goto nopatch
if not exist vaca2.patch goto nopatch
if not exist vaca3.patch goto nopatch
if not exist vaca4.patch goto nopatch
if not exist vaca5.patch goto nopatch
if not exist vaca6.patch goto nopatch
if not exist vaca7.patch goto nopatch
if not exist vacasl.patch goto nopatch
if not exist vacadm1.patch goto nopatch
if not exist vacadm2.patch goto nopatch
if not exist vacadm3.patch goto nopatch
if not exist vacadm4.patch goto nopatch
mkdir vaca_preserve
if exist vaca*.map move /y vaca*.map vaca_preserve\
if exist "%exedir%\vaca*.map" move /y "%exedir%\vaca*.map" vaca_preserve\
:: TODO: eliminate the need for the if exist checks; tighten up path handling
set grp=vacation.grp
if exist "%addondir%\%vacagrpname%" set grp=%addondir%\%vacagrpname%
if exist "%exedir%\%vacagrpname%" set grp=%exedir%\%vacagrpname%
"%kextract%" "%grp%" VACA*.MAP
ren VACA1.MAP vaca1.map
ren VACA2.MAP vaca2.map
ren VACA3.MAP vaca3.map
ren VACA4.MAP vaca4.map
ren VACA5.MAP vaca5.map
ren VACA6.MAP vaca6.map
ren VACA7.MAP vaca7.map
ren VACASL.MAP vacasl.map
ren VACADM1.MAP vacadm1.map
ren VACADM2.MAP vacadm2.map
ren VACADM3.MAP vacadm3.map
ren VACADM4.MAP vacadm4.map
if exist vacapatch*.h266 del /f /q vacapatch*.h266 
if exist vacaflag*.h266 del /f /q vacaflag*.h266 
echo.
echo Map patching will now begin.
echo.
pause
echo
"%bspatch%" vaca1.map vaca1.map vaca1.patch
"%bspatch%" vaca2.map vaca2.map vaca2.patch
"%bspatch%" vaca3.map vaca3.map vaca3.patch
"%bspatch%" vaca4.map vaca4.map vaca4.patch
"%bspatch%" vaca5.map vaca5.map vaca5.patch
"%bspatch%" vaca6.map vaca6.map vaca6.patch
"%bspatch%" vaca7.map vaca7.map vaca7.patch
"%bspatch%" vacasl.map vacasl.map vacasl.patch
"%bspatch%" vacadm1.map vacadm1.map vacadm1.patch
"%bspatch%" vacadm2.map vacadm2.map vacadm2.patch
"%bspatch%" vacadm3.map vacadm3.map vacadm3.patch
"%bspatch%" vacadm4.map vacadm4.map vacadm4.patch
if exist vacapatch*.h266 del /f /q vacapatch*.h266 
if exist vacaflag*.h266 del /f /q vacaflag*.h266 
echo Do not delete this file! You will be forced to reinstall Vaca+ and repatch the maps. >vacaflag_%addonver%.h266
attrib +r vacaflag_%addonver%.h266
echo.
echo Patching complete!
:scanning
chdir "%exedir%"
echo.
echo Scanning directory for potential problems.
if exist vaca1.mhk goto mhkfound
if exist vaca2.mhk goto mhkfound
if exist vaca3.mhk goto mhkfound
if exist vaca4.mhk goto mhkfound
if exist vaca5.mhk goto mhkfound
if exist vaca6.mhk goto mhkfound
if exist vaca7.mhk goto mhkfound
if exist vacasl.mhk goto mhkfound
if exist vacadm1.mhk goto mhkfound
if exist vacadm2.mhk goto mhkfound
if exist vacadm3.mhk goto mhkfound
if exist vacadm4.mhk goto mhkfound
if exist dcava0r.mhk goto mhkfound
if exist dcava1.mhk goto mhkfound
if exist _vacazoo.mhk goto mhkfound
:mhkfound_done
if exist TILES000.ART goto artfound
if exist TILES003.ART goto artfound
if exist TILES005.ART goto artfound
if exist TILES006.ART goto artfound
if exist TILES007.ART goto artfound
if exist TILES008.ART goto artfound
if exist TILES009.ART goto artfound
if exist TILES010.ART goto artfound
if exist TILES012.ART goto artfound
if exist TILES014.ART goto artfound
:artfound_done
call :checksum 3d5092d053b23a823c1fa0ad0b0bdbc33b2a09bb DEFS.CON "VACA15 file detected and neutralized:"
call :checksum 807aaf21edd6e315bcb76dd54450f28616f84609 GAME.CON "VACA15 file detected and neutralized:"
call :checksum 6d29c3b19d26ff84edb104e68120edc5150066dd USER.CON "VACA15 file detected and neutralized:"
call :checksum 856374f3b42a1f2e355730ffc70497a3e6a49585 BEACHBAB.CON "VACA15 file detected and neutralized:"
call :checksum efb8168c6351d4b5e2c108ebc8189d4aba85ef35 BEACHBAL.CON "VACA15 file detected and neutralized:"
call :checksum a947947409a76ea7e6c46076a8cfbaa76f8b0172 BEACHBTH.CON "VACA15 file detected and neutralized:"
call :checksum 3c11b9d40a204849c2d7d6c10984397f3b6a444c DRAGON.CON "VACA15 file detected and neutralized:"
call :checksum 1417476e2cd8a3aef85dd9c1f36308f2123d8b54 SEAGULL.CON "VACA15 file detected and neutralized:"
call :checksum 0c1314dcd983b232f6afb941942e1ccbd7331ebb SOUNDS.CON "VACA15 file detected and neutralized:"
call :checksum 032a25b2cd98e19a5ff9a859ac27c91a4abfcb46 USER.CON "VACAPP file detected and neutralized:"
call :checksum 34ed9d27095d547e20fb9db87957d17ca9cb2046 DEFS.CON "VACA13 file detected and neutralized:"
call :checksum 3480ad8caca150b7c4678a42a606c0d9941db631 GAME.CON "VACA13 file detected and neutralized:"
call :checksum 74feb12ecfa57cb4c8e151593bff89e06b1ae11e USER.CON "VACA13 file detected and neutralized:"
call :checksum 840d701ca5e1e590ff03510eb5d63880f3e5be79 BEACHBAB.CON "VACA13 file detected and neutralized:"
call :checksum f4c7080384dde2f298e807b1bc9901e6e61ac617 BEACHBAL.CON "VACA13 file detected and neutralized:"
call :checksum 9965ae6e6b4337d06e1df22b41592b4cdfb69b2f BEACHBTH.CON "VACA13 file detected and neutralized:"
call :checksum d56a1ff075671d0919540086a062b37290113621 DRAGON.CON "VACA13 file detected and neutralized:"
call :checksum 06be81473bad004296324b2d63f4730ac2160aa6 SEAGULL.CON "VACA13 file detected and neutralized:"
call :checksum ef149cd90764bae685d9fab83eb2fe719486dce3 SOUNDS.CON "VACA13 file detected and neutralized:"
if exist Vacation.con goto confound
if exist VacaEDuke.con goto confound
if exist VacaDefs.con goto confound
if exist VacaUser.con goto confound
if exist VacaDP.con goto confound
if exist VacaDPCode.con goto confound
if exist VacaDPXXX.con goto confound
if exist VSounds.con goto confound
if exist VBeachBabe.con goto confound
if exist VBeachBall.con goto confound
if exist VBeachBather.con goto confound
if exist VDragon.con goto confound
if exist VSeagull.con goto confound
:confound_done
call :conprotect
chdir /d "%addondir%"
echo.
pause
goto restart

:conprotect
pushd "%exedir%"
if not exist GAME.CON "%kextract%" DUKE3D.GRP GAME.CON
if not exist DEFS.CON "%kextract%" DUKE3D.GRP DEFS.CON
if not exist USER.CON "%kextract%" DUKE3D.GRP USER.CON
popd
goto :eof

:checksum
if not exist "%sha1sum%" (
echo "%sha1sum%" not found.
goto :eof
)
if not exist "%~2" goto :eof
echo %~1 *%~2 | "%sha1sum%" --status --check -
if "%ERRORLEVEL%"=="0" (
ren "%~2" "VacaOld_%addonver%_%~nx2"
echo %~3 %~nx2
)
goto :eof

:nopatch
echo.
echo Error: You don't have all the *.patch files in your directory.
echo Aborting installation.
echo Map patching is required for Vaca+ to function correctly.
echo.
pause
goto end

:mhkfound
echo.
echo Problematic .mhk files have been found in your directory.
echo Unless you have knowingly made a modification to Vaca's map hacks,
echo the presence of these files in your %exeproper% directory will
echo cause Vaca+ to function incorrectly.
echo.
echo vaca1.mhk
echo vaca2.mhk
echo vaca3.mhk
echo vaca4.mhk
echo vaca5.mhk
echo vaca6.mhk
echo vaca7.mhk
echo vacasl.mhk
echo vacadm1.mhk
echo vacadm2.mhk
echo vacadm3.mhk
echo vacadm4.mhk
echo dcava0r.mhk
echo dcava1.mhk
echo _vacazoo.mhk
goto mhkfound_done

:artfound
echo.
echo Problematic .art files have been found in your directory.
echo Unless you have knowingly made a modification to Vaca's art,
echo the presence of these files in your %exeproper% directory will
echo cause Vaca+ to function incorrectly.
echo.
echo TILES000.ART
echo TILES003.ART
echo TILES005.ART
echo TILES006.ART
echo TILES007.ART
echo TILES008.ART
echo TILES009.ART
echo TILES010.ART
echo TILES012.ART
echo TILES014.ART
goto artfound_done

:confound
echo.
echo Problematic .con files have been found in your directory.
echo Unless you have knowingly made a modification to Vaca's programming,
echo the presence of these files in your %exeproper% directory will
echo cause Vaca+ to function incorrectly.
echo.
echo Vacation.con
echo VacaEDuke.con
echo VacaDefs.con
echo VacaUser.con
echo VacaDP.con
echo VacaDPCode.con
echo VacaDPXXX.con
echo VSounds.con
echo VBeachBabe.con
echo VBeachBall.con
echo VBeachBather.con
echo VDragon.con
echo VSeagull.con
echo.
echo IF THESE ARE THE ORIGINAL CARIBBEAN CON FILES, OR THEY COME FROM
echo AN OUTDATED VERSION OF VACA+, REMOVE THEM FROM YOUR %exeproper% DIRECTORY
echo IMMEDIATELY!
echo Vaca+ uses modified .con files to fix programming errors created by
echo the original programmers. Due to improvements made to the levels,
echo Vaca+ will have major errors if the included .con files are not used.
goto confound_done

:execheck
if exist %exename%.bat goto execheck_done
if exist %exename%.exe goto recheck
set prevdir=%cd%
if not "%cd%"=="%cd:~0,3%" chdir ..
if not "%cd%"=="%prevdir%" goto execheck
echo Warning: You don't have %exeproper% in your directory.
chdir /d "%startdir%"
goto execheck_done

:nodir
echo.
echo Error: "vaca_plus" data directory not found.
echo Aborting launch.
echo.
pause
goto end

:end
if "%debug%"=="1" echo.
if "%debug%"=="1" pause
echo.
popd
endlocal
title %ComSpec%
color 07