@echo off

copy CtB\tisunpack.exe tisunpack.exe
tisunpack -s -h -o CTB-TIS1/AR3520.tis CtB\TIZ/AR3520.TIZ
tisunpack -s -h -o CTB-TIS1/AR3525.tis CtB\TIZ/AR3525.TIZ
tisunpack -s -h -o CTB-TIS1/AR3526.tis CtB\TIZ/AR3526.TIZ
tisunpack -s -h -o CTB-TIS1/AR3534.tis CtB\TIZ/AR3534.TIZ
tisunpack -s -h -o CTB-TIS1/AR3535.tis CtB\TIZ/AR3535.TIZ
tisunpack -s -h -o CTB-TIS1/AR3536.tis CtB\TIZ/AR3536.TIZ
tisunpack -s -h -o CTB-TIS1/AR3540.tis CtB\TIZ/AR3540.TIZ
tisunpack -s -h -o CTB-TIS1/AR3541.tis CtB\TIZ/AR3541.TIZ
tisunpack -s -h -o CTB-TIS1/AR3542.tis CtB\TIZ/AR3542.TIZ
tisunpack -s -h -o CTB-TIS1/AR3543.tis CtB\TIZ/AR3543.TIZ
tisunpack -s -h -o CTB-TIS1/AR3544.tis CtB\TIZ/AR3544.TIZ
tisunpack -s -h -o CTB-TIS1/AR3545.tis CtB\TIZ/AR3545.TIZ
tisunpack -s -h -o CTB-TIS1/AR3546.tis CtB\TIZ/AR3546.TIZ
tisunpack -s -h -o CTB-TIS1/AR3547.tis CtB\TIZ/AR3547.TIZ
tisunpack -s -h -o CTB-TIS1/AR3548.tis CtB\TIZ/AR3548.TIZ
tisunpack -s -h -o CTB-TIS1/AR3549.tis CtB\TIZ/AR3549.TIZ
tisunpack -s -h -o CTB-TIS1/AR3550.tis CtB\TIZ/AR3550.TIZ
tisunpack -s -h -o CTB-TIS1/AR3551.tis CtB\TIZ/AR3551.TIZ
tisunpack -s -h -o CTB-TIS1/AR3552.tis CtB\TIZ/AR3552.TIZ
tisunpack -s -h -o CTB-TIS1/AR3553.tis CtB\TIZ/AR3553.TIZ
tisunpack -s -h -o CTB-TIS1/AR3554.tis CtB\TIZ/AR3554.TIZ
tisunpack -s -h -o CTB-TIS1/AR3555.tis CtB\TIZ/AR3555.TIZ
tisunpack -s -h -o CTB-TIS1/AR3556.tis CtB\TIZ/AR3556.TIZ
tisunpack -s -h -o CTB-TIS1/AR3557.tis CtB\TIZ/AR3557.TIZ
tisunpack -s -h -o CTB-TIS1/AR3558.tis CtB\TIZ/AR3558.TIZ
tisunpack -s -h -o CTB-TIS1/AR3559.tis CtB\TIZ/AR3559.TIZ
tisunpack -s -h -o CTB-TIS2/AR3560.tis CtB\TIZ/AR3560.TIZ
tisunpack -s -h -o CTB-TIS2/AR3570.tis CtB\TIZ/AR3570.TIZ
tisunpack -s -h -o CTB-TIS2/AR3575.tis CtB\TIZ/AR3575.TIZ
tisunpack -s -h -o CTB-TIS2/AR3578.tis CtB\TIZ/AR3578.TIZ
tisunpack -s -h -o CTB-TIS2/AR3579.tis CtB\TIZ/AR3579.TIZ
tisunpack -s -h -o CTB-TIS2/AR3580.tis CtB\TIZ/AR3580.TIZ
tisunpack -s -h -o CTB-TIS2/AR3581.tis CtB\TIZ/AR3581.TIZ
tisunpack -s -h -o CTB-TIS2/AR3582.tis CtB\TIZ/AR3582.TIZ
tisunpack -s -h -o CTB-TIS2/AR3583.tis CtB\TIZ/AR3583.TIZ
tisunpack -s -h -o CTB-TIS2/AR3584.tis CtB\TIZ/AR3584.TIZ
tisunpack -s -h -o CTB-TIS2/AR3585.tis CtB\TIZ/AR3585.TIZ
tisunpack -s -h -o CTB-TIS2/AR3586.tis CtB\TIZ/AR3586.TIZ
tisunpack -s -h -o CTB-TIS2/AR3587.tis CtB\TIZ/AR3587.TIZ
tisunpack -s -h -o CTB-TIS2/AR3588.tis CtB\TIZ/AR3588.TIZ
tisunpack -s -h -o CTB-TIS2/AR3590.tis CtB\TIZ/AR3590.TIZ
tisunpack -s -h -o CTB-TIS2/AR3591.tis CtB\TIZ/AR3591.TIZ
tisunpack -s -h -o CTB-TIS2/AR3594.tis CtB\TIZ/AR3594.TIZ
tisunpack -s -h -o CTB-TIS2/AR3597.tis CtB\TIZ/AR3597.TIZ
tisunpack -s -h -o CTB-TIS2/AR3598.tis CtB\TIZ/AR3598.TIZ
tisunpack -s -h -o CTB-TIS2/AR3599.tis CtB\TIZ/AR3599.TIZ
tisunpack -s -h -o CTB-TIS3/AR3600.tis CtB\TIZ/AR3600.TIZ
tisunpack -s -h -o CTB-TIS3/AR3601.tis CtB\TIZ/AR3601.TIZ
tisunpack -s -h -o CTB-TIS3/AR3610.tis CtB\TIZ/AR3610.TIZ
tisunpack -s -h -o CTB-TIS3/AR3610N.tis CtB\TIZ/AR3610N.TIZ
tisunpack -s -h -o CTB-TIS3/AR3611.tis CtB\TIZ/AR3611.TIZ
tisunpack -s -h -o CTB-TIS3/AR3611N.tis CtB\TIZ/AR3611N.TIZ
tisunpack -s -h -o CTB-TIS3/AR3613.tis CtB\TIZ/AR3613.TIZ
tisunpack -s -h -o CTB-TIS3/AR3613N.tis CtB\TIZ/AR3613N.TIZ
tisunpack -s -h -o CTB-TIS3/AR3675.tis CtB\TIZ/AR3675.TIZ
tisunpack -s -h -o CTB-TIS3/AR3616.tis CtB\TIZ/AR3616.TIZ
tisunpack -s -h -o CTB-TIS3/AR3617.tis CtB\TIZ/AR3617.TIZ
tisunpack -s -h -o CTB-TIS3/AR3618.tis CtB\TIZ/AR3618.TIZ
tisunpack -s -h -o CTB-TIS3/AR3619.tis CtB\TIZ/AR3619.TIZ
tisunpack -s -h -o CTB-TIS3/AR3620.tis CtB\TIZ/AR3620.TIZ
tisunpack -s -h -o CTB-TIS3/AR3621.tis CtB\TIZ/AR3621.TIZ
tisunpack -s -h -o CTB-TIS3/AR3622.tis CtB\TIZ/AR3622.TIZ
tisunpack -s -h -o CTB-TIS3/AR3623.tis CtB\TIZ/AR3623.TIZ
tisunpack -s -h -o CTB-TIS3/AR3624.tis CtB\TIZ/AR3624.TIZ
tisunpack -s -h -o CTB-TIS3/AR3625.tis CtB\TIZ/AR3625.TIZ
tisunpack -s -h -o CTB-TIS3/AR3626.tis CtB\TIZ/AR3626.TIZ
tisunpack -s -h -o CTB-TIS3/AR3627.tis CtB\TIZ/AR3627.TIZ
tisunpack -s -h -o CTB-TIS3/AR3628.tis CtB\TIZ/AR3628.TIZ
tisunpack -s -h -o CTB-TIS3/AR3629.tis CtB\TIZ/AR3629.TIZ
tisunpack -s -h -o CTB-TIS3/AR3630.tis CtB\TIZ/AR3630.TIZ
tisunpack -s -h -o CTB-TIS3/AR3632.tis CtB\TIZ/AR3632.TIZ
tisunpack -s -h -o CTB-TIS3/AR3633.tis CtB\TIZ/AR3633.TIZ
tisunpack -s -h -o CTB-TIS3/AR3634.tis CtB\TIZ/AR3634.TIZ
tisunpack -s -h -o CTB-TIS3/AR3635.tis CtB\TIZ/AR3635.TIZ
tisunpack -s -h -o CTB-TIS3/AR3636.tis CtB\TIZ/AR3636.TIZ
tisunpack -s -h -o CTB-TIS3/AR3637.tis CtB\TIZ/AR3637.TIZ
tisunpack -s -h -o CTB-TIS3/AR3638.tis CtB\TIZ/AR3638.TIZ
tisunpack -s -h -o CTB-TIS3/AR3640.tis CtB\TIZ/AR3640.TIZ
tisunpack -s -h -o CTB-TIS3/AR3641.tis CtB\TIZ/AR3641.TIZ
tisunpack -s -h -o CTB-TIS3/AR3642.tis CtB\TIZ/AR3642.TIZ
tisunpack -s -h -o CTB-TIS3/AR3643.tis CtB\TIZ/AR3643.TIZ
tisunpack -s -h -o CTB-TIS3/AR3644.tis CtB\TIZ/AR3644.TIZ
tisunpack -s -h -o CTB-TIS3/AR3645.tis CtB\TIZ/AR3645.TIZ
tisunpack -s -h -o CTB-TIS3/AR3646.tis CtB\TIZ/AR3646.TIZ
tisunpack -s -h -o CTB-TIS3/AR3650.tis CtB\TIZ/AR3650.TIZ
tisunpack -s -h -o CTB-TIS3/AR3651.tis CtB\TIZ/AR3651.TIZ
tisunpack -s -h -o CTB-TIS3/AR3652.tis CtB\TIZ/AR3652.TIZ
tisunpack -s -h -o CTB-TIS3/CB3661.tis CtB\TIZ/CB3661.TIZ
tisunpack -s -h -o CTB-TIS3/CB3662.tis CtB\TIZ/CB3662.TIZ
tisunpack -s -h -o CTB-TIS3/CB3663.tis CtB\TIZ/CB3663.TIZ
tisunpack -s -h -o CTB-TIS3/CB3664.tis CtB\TIZ/CB3664.TIZ
tisunpack -s -h -o CTB-TIS3/CB3665.tis CtB\TIZ/CB3665.TIZ
tisunpack -s -h -o CTB-TIS3/CB3666.tis CtB\TIZ/CB3666.TIZ
tisunpack -s -h -o CTB-TIS3/CB3667.tis CtB\TIZ/CB3667.TIZ
tisunpack -s -h -o CTB-TIS3/CB3668.tis CtB\TIZ/CB3668.TIZ
del tisunpack.exe

xcopy /q CtB\sound\*.* CTB-WAV\*.*

move override\*.ogg CTB-WAV
copy CtB\oggdec.exe CTB-WAV\*.*
cd CTB-WAV
oggdec *.ogg
del *.ogg
del oggdec.exe
cd..

xcopy /q /e /y CTB\music\*.* music\*.*

move override\*.ARE CTB-ARE
move override\*.WED CTB-ARE
weidu --make-biff CTB-ARE
call CtB\deldir CTB-ARE

move override\*.BAM CTB-BAM
weidu --make-biff CTB-BAM
call CtB\deldir CTB-BAM

move override\*.BCS CTB-BCS
weidu --make-biff CTB-BCS
call CtB\deldir CTB-BCS

move override\*.CRE CTB-CRE
move override\*.DLG CTB-CRE
weidu --make-biff CTB-CRE
call CtB\deldir CTB-CRE
call CtB\deldir CTBDLG

move override\*.ITM CTB-ITM
weidu --make-biff CTB-ITM
call CtB\deldir CTB-ITM

move override\*.MOS CTB-MOS
move override\*.BMP CTB-MOS
weidu --make-biff CTB-MOS
call CtB\deldir CTB-MOS

move override\*.2DA CTB-RULE
move override\*.CH* CTB-RULE
::move override\*.IDS CTB-RULE
move override\*.WMP CTB-RULE
move override\*.EFF CTB-RULE
move override\*.PRO CTB-RULE
move override\*.VVC CTB-RULE
move override\*.SPL CTB-RULE
move override\*.STO CTB-RULE
weidu --make-biff CTB-RULE
call CtB\deldir CTB-RULE

weidu --make-biff CTB-TIS1
call CtB\deldir CTB-TIS1

weidu --make-biff CTB-TIS2
call CtB\deldir CTB-TIS2

weidu --out CTB-TIS3 --biff-get-rest AM1700*.WAV
ren CTB-TIS3\AM1700.WAV AM3675.WAV
ren CTB-TIS3\AM1700N.WAV AM3675N.WAV
weidu --make-biff CTB-TIS3
call CtB\deldir CTB-TIS3

move override\*.WAV CTB-WAV
move override\*.MVE CTB-WAV
weidu --make-biff CTB-WAV
call CtB\deldir CTB-WAV

@echo.
@echo Installation of the core CtB package is complete.
@echo.
pause

Setup-CtB-Chores.exe

notepad CtB\text\CtB-Version.txt

