@echo off
if not X%1X==XX goto gotdir
echo.
echo. You need to specify the name of the drive and subdirectory
echo. where you want 22DISK installed.  For example:
echo.
echo.           %0 C:\MY22
echo.
echo  Run this command again, but specify a location for installation.
echo.
goto stopit
:gotdir
rem Now check for files
if not exist ctod.exe goto nofiles
if not exist cfmt.exe goto nofiles
if not exist cdir.exe goto nofiles
if not exist cera.exe goto nofiles
if not exist dtoc.exe goto nofiles
if not exist ctype.exe goto nofiles
if not exist genindex.exe goto nofiles
if not exist stripidx.exe goto nofiles
if not exist cmenu.exe goto nofiles
if not exist cpmdisks.def goto nofiles
if not exist viewconf.exe goto nofiles
rem Create the subdirectory, gobble any errors.
copy read.me! %1>nul
if not exist %1 goto dirtest2
del %1
mkdir %1
:dirtest2
echo Copying files...please wait
copy /b ctod.exe %1>nul
if errorlevel 1 goto copyerr
copy /b cfmt.exe %1>nul
if errorlevel 1 goto copyerr
copy /b cdir.exe %1>nul
if errorlevel 1 goto copyerr
copy /b cera.exe %1>nul
if errorlevel 1 goto copyerr
copy /b dtoc.exe %1>nul
if errorlevel 1 goto copyerr
copy /b ctype.exe %1>nul
if errorlevel 1 goto copyerr
copy /b genindex.exe %1>nul
if errorlevel 1 goto copyerr
copy /b stripidx.exe %1>nul
if errorlevel 1 goto copyerr
copy /b cmenu.exe %1>nul
if errorlevel 1 goto copyerr
copy /b cpmdisks.def %1>nul
if errorlevel 1 goto copyerr
copy /b viewconf.exe %1>nul
if errorlevel 1 goto copyerr
copy /b read.me! %1>nul
copy /b config.txt %1>nul
cls
echo All files have been copied and installation is complete.
echo To run 22DISK, just CD to the %1 directory and enter:
echo.
echo                    CMENU
echo.
echo If you have added a second diskette controller and need information
echo on setting it up, please consult the document CONFIG.TXT.
echo.
goto stopit
:nofiles
echo.
echo To install 22DISK, you must be logged to the disk drive where
echo the installation files exist.  For example, if you install from
echo the A: diskette drive, you must be logged onto drive A:.
echo.
goto stopit
:copyerr
echo Copying the 22DISK files didn't work.  Perhaps you mis-spelled
echo the destination path.  Please try again.
echo.
:stopit