echo off

if not exist duke3d.exe goto error

:menu
cls
echo.
echo ===============================================================================
echo               P L A T O O N   -   T O T A L   C O N V E R S I O N              
echo ===============================================================================
echo.
echo.
echo                       1     Install Platoon TC
echo                       2     Uninstall Platoon TC
echo                       3     Read the text file
echo                       4     Exit
echo.
echo.
echo.
echo.
echo.

if exist platoon.on echo Platoon TC - INSTALLED
if exist platoon.off echo Platoon TC - NOT INSTALLED
choice /c:1234 
if errorlevel 4 goto exit
if errorlevel 3 goto text
if errorlevel 2 goto uninstall
if errorlevel 1 goto install 

:error
echo.
echo Are you sure that the files are in the right directory ?
echo.
goto end

:exit
goto end

:text
type platoon.txt |more
pause
goto menu

:p2
echo.
echo Platoon TC is not installed !!!
echo.
pause
goto menu

:uninstall
if exist platoon.off goto p2
echo.
echo Are you sure you want to uninstall Platoon TC ?
echo. 
choice /c:yn
if errorlevel 2 goto menu
if errorlevel 1 goto remove2

:remove2
cls
echo.
echo Uninstalling Platoon TC 
echo [ CTRL+BREAK to stop ] 
echo.

del plt001.voc
del plt002.voc
del plt003.voc
del plt004.voc
del plt005.voc
del plt006.voc
del plt007.voc
del plt008.voc
del plt009.voc
del plt010.voc
del plt011.voc
del plt012.voc
del plt013.voc
del plt014.voc
del plt015.voc
del plt016.voc
del plt017.voc
del plt018.voc
del plt019.voc
del plt020.voc
del plt021.voc
del plt022.voc
del plt023.voc
del plt024.voc
del plt025.voc
del plt026.voc
del plt027.voc
del plt028.voc
del plt029.voc
del plt030.voc
del plt031.voc
del plt032.voc
del plt033.voc
del plt034.voc
del plt035.voc

del game.con
del plt_user.con
del plt_defs.con

del demo1.dmo
del demo2.dmo

del tiles000.art
del tiles005.art
del tiles006.art
del tiles007.art
del tiles008.art
del tiles009.art
del tiles010.art
del tiles011.art
del tiles012.art
del tiles015.art

del plt_e1l1.map
del plt_e1l2.map
del plt_e1l3.map
del plt_e1l4.map
del plt_e1l5.map
del plt_e1l6.map
del plt_e2l1.map
del plt_e2l2.map
del plt_e2l3.map
del plt_e2l4.map
del plt_e2l5.map
del plt_e2l6.map
del plt_e2l7.map

del plt101.mid
del plt102.mid
del plt103.mid
del plt104.mid
del plt105.mid
del plt106.mid
del plt107.mid
del plt108.mid

if exist game_con.bak rename game_con.bak game.con
if exist dmo1_dmo.bak rename dmo1_dmo.bak demo1.dmo
if exist dmo2_dmo.bak rename dmo2_dmo.bak demo2.dmo
if exist til_000.bak rename til_000.bak tiles000.art
if exist til_005.bak rename til_005.bak tiles005.art
if exist til_006.bak rename til_006.bak tiles006.art
if exist til_007.bak rename til_007.bak tiles007.art
if exist til_008.bak rename til_008.bak tiles008.art
if exist til_009.bak rename til_009.bak tiles009.art
if exist til_010.bak rename til_010.bak tiles010.art
if exist til_011.bak rename til_011.bak tiles011.art
if exist til_012.bak rename til_012.bak tiles012.art
if exist til_015.bak rename til_015.bak tiles015.art

rename platoon.on platoon.off
echo.
echo Platoon TC successfully uninstalled !
echo.
goto end


:p1
echo.
echo You have already installed Platoon TC !!!
echo.
pause
goto menu

:install
if exist platoon.on goto p1
cls
echo.
echo Installing Platoon TC
echo [ CTRL+BREAK to stop ]
echo.
pause

echo Backing up original files...
echo.

if exist game.con rename game.con game_con.bak

if exist demo1.dmo rename demo1.dmo dmo1_dmo.bak
if exist demo2.dmo rename demo2.dmo dmo2_dmo.bak

if exist tiles000.art rename tiles000.art til_000.bak
if exist tiles005.art rename tiles005.art til_005.bak
if exist tiles006.art rename tiles006.art til_006.bak
if exist tiles007.art rename tiles007.art til_007.bak
if exist tiles008.art rename tiles008.art til_008.bak
if exist tiles009.art rename tiles009.art til_009.bak
if exist tiles010.art rename tiles010.art til_010.bak
if exist tiles011.art rename tiles011.art til_011.bak
if exist tiles012.art rename tiles012.art til_012.bak
if exist tiles015.art rename tiles015.art til_015.bak


echo Done.
echo.

echo Creating new files...
echo.
rename platoon.dat plt_data.exe
plt_data.exe
echo.
rename plt_data.exe platoon.dat
echo.
echo Checking that PLATOON.DAT included all files...
echo.

if not exist game.con echo Can't find game.con
if not exist plt_user.con echo Can't find plt_user.con
if not exist plt_defs.con echo Can't find plt_defs.con

if not exist demo1.dmo echo Can't find demo1.dmo
if not exist demo2.dmo echo Can't find demo2.dmo

if not exist tiles000.art echo Can't find tiles000.art
if not exist tiles005.art echo Can't find tiles005.art
if not exist tiles006.art echo Can't find tiles006.art
if not exist tiles007.art echo Can't find tiles007.art
if not exist tiles008.art echo Can't find tiles008.art
if not exist tiles009.art echo Can't find tiles009.art
if not exist tiles010.art echo Can't find tiles010.art
if not exist tiles011.art echo Can't find tiles011.art
if not exist tiles012.art echo Can't find tiles012.art
if not exist tiles015.art echo Can't find tiles015.art

if not exist plt001.voc echo Can't find plt001.voc
if not exist plt002.voc echo Can't find plt002.voc
if not exist plt003.voc echo Can't find plt003.voc
if not exist plt004.voc echo Can't find plt004.voc
if not exist plt005.voc echo Can't find plt005.voc
if not exist plt006.voc echo Can't find plt006.voc
if not exist plt007.voc echo Can't find plt007.voc
if not exist plt008.voc echo Can't find plt008.voc
if not exist plt009.voc echo Can't find plt009.voc
if not exist plt010.voc echo Can't find plt010.voc
if not exist plt011.voc echo Can't find plt011.voc
if not exist plt012.voc echo Can't find plt012.voc
if not exist plt013.voc echo Can't find plt013.voc
if not exist plt014.voc echo Can't find plt014.voc
if not exist plt015.voc echo Can't find plt015.voc
if not exist plt016.voc echo Can't find plt016.voc
if not exist plt017.voc echo Can't find plt017.voc
if not exist plt018.voc echo Can't find plt018.voc
if not exist plt019.voc echo Can't find plt019.voc
if not exist plt020.voc echo Can't find plt020.voc
if not exist plt021.voc echo Can't find plt021.voc
if not exist plt022.voc echo Can't find plt022.voc
if not exist plt023.voc echo Can't find plt023.voc
if not exist plt024.voc echo Can't find plt024.voc
if not exist plt025.voc echo Can't find plt025.voc
if not exist plt026.voc echo Can't find plt026.voc
if not exist plt027.voc echo Can't find plt027.voc
if not exist plt028.voc echo Can't find plt028.voc
if not exist plt029.voc echo Can't find plt029.voc
if not exist plt030.voc echo Can't find plt030.voc
if not exist plt031.voc echo Can't find plt031.voc
if not exist plt032.voc echo Can't find plt032.voc
if not exist plt033.voc echo Can't find plt033.voc
if not exist plt034.voc echo Can't find plt034.voc
if not exist plt035.voc echo Can't find plt035.voc

if not exist plt_e1l1.map echo Can't find plt_e1l1.map
if not exist plt_e1l2.map echo Can't find plt_e1l2.map
if not exist plt_e1l3.map echo Can't find plt_e1l3.map
if not exist plt_e1l4.map echo Can't find plt_e1l4.map
if not exist plt_e1l5.map echo Can't find plt_e1l5.map
if not exist plt_e1l6.map echo Can't find plt_e1l6.map

if not exist plt_e2l1.map echo Can't find plt_e2l1.map
if not exist plt_e2l2.map echo Can't find plt_e2l2.map
if not exist plt_e2l3.map echo Can't find plt_e2l3.map
if not exist plt_e2l4.map echo Can't find plt_e2l4.map
if not exist plt_e2l5.map echo Can't find plt_e2l5.map
if not exist plt_e2l6.map echo Can't find plt_e2l6.map
if not exist plt_e2l7.map echo Can't find plt_e2l7.map

if not exist plt101.mid echo Can't find plt101.mid
if not exist plt102.mid echo Can't find plt102.mid
if not exist plt103.mid echo Can't find plt103.mid
if not exist plt104.mid echo Can't find plt104.mid
if not exist plt105.mid echo Can't find plt105.mid
if not exist plt106.mid echo Can't find plt106.mid
if not exist plt107.mid echo Can't find plt107.mid
if not exist plt108.mid echo Can't find plt108.mid

echo Done.
echo.
rename platoon.off platoon.on
echo Installation complete !
echo.
pause
cls
echo.
echo Type DUKE3D to play Platoon TC in Single Player or SETUP if you 
echo want to play Cooperative/Dukematch
echo.
echo NOTE: All players must have Platoon TC installed in multiplayer !
goto end

:end
echo.
echo Platoon - Total Conversion
echo by TNT Team
echo.
echo tnt@mbnet.fi
echo http://www.mbnet.fi/~tnt
echo.




