echo off
cls

if not exist duke3d.exe goto error
if exist cd.ini goto seedy

:menu
cls
echo.
echo ===============================================================================
echo               D U K E   C T F -   T O T A L   C O N V E R S I O N              
echo ===============================================================================
echo.
echo.
echo                       1     Install Duke CTF
echo                       2     Uninstall Duke CTF
echo                       3     Read the text file
echo                       4     Read the Level making FAQ
echo                       5     Exit
echo.
echo.
echo.
echo.
echo.

if exist ctf.on echo Duke Nukem CTF - INSTALLED
if exist ctf.off echo Duke Nukem CTF - NOT INSTALLED
choice /c:12345 
if errorlevel 5 goto exit
if errorlevel 4 goto lev
if errorlevel 3 goto text
if errorlevel 2 goto uninstall
if errorlevel 1 goto install 

:error
echo.
echo For Duke Nukem CTF to work it must be in your Duke 3d directory.
echo.
goto end

:seedy
echo Duke CTF is only available for Duke Nukem version 1.3D at the moment.

:exit
goto end

:text
type DukeCTF.txt |more
pause
goto menu

:lev
type ctflevel.txt |more
pause
goto menu

:p2
echo.
echo Duke CTF is not installed !!!
echo.
pause
goto menu

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

:remove2
cls
echo.
echo Uninstalling Duke CTF 
echo [ CTRL+BREAK to stop ] 
echo.

erase tiles009.art
erase tiles000.art
erase tiles004.art
erase demo1.dmo
erase game.con
erase duke3d.bin

copy /y tiles9bu.art tiles009.art
copy /y tiles0bu.art tiles000.art
copy /y tiles4bu.art tiles004.art
copy /y demo1bu.dmo demo1.dmo
copy /y demo2bu.dmo demo2.dmo
copy /y demo3bu.dmo demo3.dmo
copy /y gamebu.con game.con
copy /y binbu.bin duke3d.bin

rename ctf.on ctf.off
echo.
echo Duke CTF successfully uninstalled !
echo.
goto end


:p1
echo.
echo You have already installed Duke CTF !!!
echo.
pause
goto menu

:install
if exist ctf.on goto p1
cls
echo.
echo Installing Duke CTF
echo [ CTRL+BREAK to stop ]
echo.
pause

if exist tiles9bu.art copy /y tiles9bu.art tiles009.art
if exist tiles0bu.art copy /y tiles0bu.art tiles000.art
if exist tiles4bu.art copy /y tiles4bu.art tiles004.art
if exist gamebu.con copy /y gamebu.con game.con
if exist binbu.bin copy /y binbu.bin duke3d.bin

copy /y tiles009.art tiles9bu.art
copy /y tiles000.art tiles0bu.art
copy /y tiles004.art tiles4bu.art
copy /y demo1.dmo demo1bu.dmo
copy /y demo1.dmo demo2bu.dmo
copy /y demo1.dmo demo3bu.dmo
copy /y game.con gamebu.con
copy /y duke3d.bin binbu.bin


copy /y CTF009.art tiles009.art
copy /y CTF000.art tiles000.art
copy /y CTF004.art tiles004.art
copy /y ctfdemo.dmo demo1.dmo
copy /y ctfgame.con game.con
copy /y ctf.bin duke3d.bin


echo Done.
echo.
rename ctf.off ctf.on
echo Installation complete !
echo.
pause
cls
echo.
echo Type SETUP if you want to play Duke CTF
echo This TC is most likely compatible with Heat, Wireplay and other
echo online gaming services.
echo.
echo NOTE: All players must have Duke CTF installed on their PCs !
goto end

:end
echo.
echo Duke CTF v1.2
echo by Mighty7
echo.
echo DukeCTF@hotmail.com
echo http://www.dukeworld.com/ctf/
echo.




