@echo off
echo Cadkey/DataCAD (DOS) Driver Installation
if %1x == x goto usage
if %2x == x goto usage
if not exist %1\lzcopy.exe goto insdk
if exist %2\cadkey.exe goto do1
if exist %2\dcad.exe goto do2
goto usage2
:do2
%1\lzcopy.exe %1\cadkey\ck_911.ex_ %2\drv\ck_911.exe
%1\lzcopy.exe %1\cadkey\dl_911.ex_ %2\drv\dl_911.exe
if not exist %2\drv\drivers.gd4 goto lab1
%1\lzcopy.exe %1\cadkey\drivers.g_4 %2\drv\drivers4.$$$
echo Append %2\drv\drivers.gd4
copy %2\drv\drivers.gd4 %2\drv\drivers4.bak > nul
copy %2\drv\drivers4.bak+%2\drv\drivers4.$$$ %2\drv\drivers.gd4 > nul
del %2\drv\drivers4.$$$ > nul
goto lab11
:lab1
%1\lzcopy.exe %1\cadkey\drivers.g_4 %2\drv\drivers.gd4
:lab11
if not exist %2\drv\drivers.gd2 goto lab2
%1\lzcopy.exe %1\cadkey\drivers.g_2 %2\drv\drivers2.$$$
echo Append %2\drv\drivers.gd2
copy %2\drv\drivers.gd2 %2\drv\drivers2.bak > nul
copy %2\drv\drivers2.bak+%2\drv\drivers2.$$$  %2\drv\drivers.gd2 > nul
del %2\drv\drivers2.$$$ > nul
goto lab22
:lab2
%1\lzcopy.exe %1\cadkey\drivers.g_2 %2\drv\drivers.gd2
:lab22
if exist %2\config.exe goto st1
if exist %2\config.com goto st1
if exist %2\config.bat goto st1
goto err2
:st1
%2\config
goto theend
:do1
%1\lzcopy.exe %1\cadkey\ck_911.ex_ %2\ck_911.exe
if not exist %2\grdev.dat goto lab3
%1\lzcopy.exe %1\cadkey\grdev.da_ %2\grdev.$$$
copy %2\grdev.dat %2\grdev.bak > nul
copy %2\grdev.bak+%2\grdev.$$$ %2\grdev.dat > nul
del  %2\grdev.$$$ > nul
goto lab33
:lab3
%1\lzcopy.exe %1\cadkey\grdev.da_ %2\grdev.dat
:lab33
if exist %2\config.exe goto setup2
if exist %2\config.com goto setup2
if exist %2\config.bat goto setup2
goto err2
:setup2
%2\config
goto theend
:insdk
echo Please insert the Utilities and Drivers Diskette
goto usage
:err2
echo Cannot configure Cadkey/DataCAD
goto theend
:usage2
echo Cannot find Cadkey/DataCAD in the directory %2
:usage
echo [Usage]: INSTALL [Source Drive:] [Target Directory]
:error
:theend
