@echo off
cls
echo+

REM check
if not exist .\newinst\config.sys goto msg1
if "%1" == "" goto msg2
if exist %1\DISKIMGS\LOADDSKF.EXE goto start
echo %1 does not seem to contain the OS/2 installation files.
exit

REM start floppy creation
:start

	echo This program will create 3 boot diskettes which can be used to boot
	echo to OS/2 and to setup and run UpdCD on a FAT, FAT32 or HPFS partition.
	pause

	REM Create disk 0
	echo+
	echo Label a blank diskette "UpdCD Diskette 0" and insert it into Drive A:
	pause
	echo+
	echo Creating UpdCD Diskette 0...
	%1\DISKIMGS\LOADDSKF %1\DISKIMGS\OS2\35\DISK0.DSK A: /Y/Q/F
	if ERRORLEVEL 1 goto bad
	echo+
	del A:\bundle
	del A:\readme.cid
	del A:\readme.ins
	del A:\xdfcopy.exe
	del A:\xdf.msg
	del A:\xdfh.msg
	del A:\config.x
	del A:\dmf_ps2.cmd

	REM Create disk 2
	echo+
	echo Please remove the diskette from Drive A:
	pause
	echo+
	echo Label another blank diskette "UpdCD Diskette 2" and insert it into Drive A:
	pause
	echo+
	echo Creating UpdCD Diskette 2...
	%1\DISKIMGS\LOADDSKF %1\DISKIMGS\OS2\35\DISK2.DSK A: /Y/Q/F
	if ERRORLEVEL 1 goto bad
	echo+
	del A:\bundle
	del A:\cdboot.exe
	del A:\sysinst?.exe
	del A:\marketng.msg
	del A:\del.lst
	copy bin\f32stat.exe A:
	copy bin\cachef32.exe A:
	copy bin\monitor.exe A:
	copy bin\ufat32.dll A:
	copy bin\fat32.ifs A:
	copy bin\vfdisk.sys A:
	copy bin\aspirout.sys A:
	echo @echo off > A:\WELCOME.CMD
	echo cls >> A:\WELCOME.CMD
	echo echo+ >> A:\WELCOME.CMD
	echo echo Switch to the UpdCD directory and run WinInst.Cmd. This program >> A:\WELCOME.CMD
	echo echo will setup the UpdCD maintanace system on your machine which will >> A:\WELCOME.CMD
	echo echo enable you to setup and to run UpdCD. >> A:\WELCOME.CMD

	REM create disk 1
	echo+
	echo Please remove the diskette from Drive A:
	pause
	echo+
	echo Label another blank diskette "UpdCD Diskette 1" and insert it into Drive A:
	pause
	echo+
	echo Creating UpdCD Diskette 1...
	%1\DISKIMGS\LOADDSKF %1\DISKIMGS\OS2\35\DISK1_CD.DSK A: /Y/Q/F
	if ERRORLEVEL 1 goto bad
	echo+
	del A:\cdinst.exe
	del A:\xdfloppy.flt
	del A:\ibm2*.add
	del A:\readme.ins
	del A:\config.x
	del A:\ibm1s506.add
	del A:\ibmidecd.flt
	copy newinst\nulldev.sys A:\aha152x.add
	copy newinst\nulldev.sys A:\aha154x.add
	copy newinst\nulldev.sys A:\aha164x.add
	copy newinst\nulldev.sys A:\aha174x.add
	copy newinst\nulldev.sys A:\aic7770.add
	copy newinst\nulldev.sys A:\btscsi.add
	copy newinst\nulldev.sys A:\dac960.add
	copy newinst\nulldev.sys A:\dpt20xx.add
	copy newinst\nulldev.sys A:\fd16-700.add
	copy newinst\nulldev.sys A:\fd7000ex.add
	copy newinst\nulldev.sys A:\fd8xx.add
	copy newinst\nulldev.sys A:\flashpt.add
	copy newinst\nulldev.sys A:\ipsraid.add
	copy newinst\nulldev.sys A:\ql10os2.add
	copy newinst\nulldev.sys A:\ql40os2.add
	copy newinst\nulldev.sys A:\ql510.add
	copy newinst\nulldev.sys A:\tmv1scsi.add
	copy newinst\config.sys A:
	copy bin\partfilt.flt A:
	copy bin\DaniS506.ADD A:
	copy bin\DaniATAP.FLT A:

	REM final message
	echo+
	echo+
	echo UpdCD has replaced IBM1S506.ADD and IBMIDECD.FLT (IDE drivers) with 
	echo a recent version of DaniS506.ADD and DaniATAP.FLT. This will enable
	echo the OS/2 maintanance system to access large IDE disks.
	echo+
	echo UpdCD has also replaced the SCSI drivers (except AIC7870.ADD) with 
	echo a dummy driver to save space. If you still need one of those or an  
	echo other SCSI driver to access your hard disk you need to manually 
	echo copy it to disk 1. If the corresponding BASEDEV statement is not in 
	echo A:\Config.Sys you need to add it before proceeding. You may find
	echo the replaced drivers on your original Warp 4 installation disk 1.
	echo+
	pause
	echo+
	echo Please remove the diskette from Drive A: and reinsert diskette 0.
	echo Restart your system and boot from drive A:. If your system hangs or
	echo traps, reboot. When the white OS/2 blob appears in the upper left
	echo corner of the screen press ALT-F2. The system will now list the drivers
	echo as they are loaded. Write down the last driver before the system hangs
	echo or traps. Try to replace the driver with a newer/older version and try
	echo again.
	echo+
	pause

exit

REM Usage Message
:msg1
	echo Cannot find newinst\config.sys!
	echo Did you run this script from the UpdCD directory?
exit

REM Usage Message
:msg2
	echo Usage: MkDisks.Bat [path to OS/2 installation CD-ROM]
	echo Example: MkDisks.Bat D:, MkDisks.Bat H:\CDROM\WARP4, etc.
exit

REM Error during disk creation
:bad
	echo A problem occured while creating the disk.
	echo You may retry it with another diskette.
exit
