@echo off
If "%3"=="GoOn" goto GoOn
If "%3"=="CleanUp" goto CleanUp
cls
echo ÿ
echo		* * * * * * * * * * * * * * * * * * * * * * * * * * * *	* * * * *
echo		*								*
echo		*	This batch job will prepare a machine with the DOS DLC	*
echo		*	driver supporting the PCA 16/4, ISA 16/4, MC 16/4 and	*
echo		*	EISA 16/4 Token-Ring adapters.				*
echo		*								*
echo		*	If NetBios support is required, you will need the	*
echo		*	IBM Lan Support Program diskette.			*
echo		*								*
If "%1"=="a:" goto SrcDrvOK
If "%1"=="A:" goto SrcDrvOK
If "%1"=="b:" goto SrcDrvOK
If "%1"=="B:" goto SrcDrvOK
:SrcDrvBad
echo		* * * * * * * * * * * * * * * * * * * * * * * * * * * *	* * * * *
echo ÿ
echo		Specify either A: or B: as the drive containing the adapter
echo		driver diskette.
goto ErrEx
:SrcDrvOK
if not exist %1\IBM\DOS\INSTIBM.BAT goto SrcDrvBad
If "%2"=="a:" goto DestDrvOK
If "%2"=="A:" goto DestDrvOK
If "%2"=="b:" goto DestDrvOK
If "%2"=="B:" goto DestDrvOK
If "%2"=="c:" goto DestDrvOK
If "%2"=="C:" goto DestDrvOK
If "%2"=="d:" goto DestDrvOK
If "%2"=="D:" goto DestDrvOK
If "%2"=="e:" goto DestDrvOK
If "%2"=="E:" goto DestDrvOK
If "%2"=="f:" goto DestDrvOK
If "%2"=="F:" goto DestDrvOK
If "%2"=="g:" goto DestDrvOK
If "%2"=="G:" goto DestDrvOK
:DestDrvBad
echo		* * * * * * * * * * * * * * * * * * * * * * * * * * * *	* * * * *
echo ÿ
echo		Destination drive must be specified.
:ErrEx
echo ÿ
echo		For example:
echo		INSTIBM A: C:
echo		to copy device driver files from the adapter diskette
echo		in drive A: to the directory C:\NETWORK
goto Done
:DestDrvOK
echo		*	Press Ctrl/C to abort or any other key to continue.	*
echo		* * * * * * * * * * * * * * * * * * * * * * * * * * * *	* * * * *
pause >nul
md %2\NETWORK >nul
cls
copy %1\IBM\DOS\INSTIBM.BAT %2\NETWORK >nul
if not exist %2\NETWORK\INSTIBM.BAT goto DestDirBad
copy %1\IBM\DOS\ASKUSER.COM %2\NETWORK >nul
if     exist %2\NETWORK\ASKUSER.COM goto DestDirOK
:DestDirBad
echo		Unable to access destination drive %2 -	installation aborted.
goto Done
:DestDirOK
%2\NETWORK\INSTIBM %1 %2 GoOn
:GoOn
echo Copying DLC driver DT02DLC.SYS.
echo This DLC driver implements an 802.3 interface. It provides the same
echo functionality as the IBM counterpart DXMC0MOD.SYS.
copy %1\IBM\DOS\DT02DLC.SYS %2\NETWORK >nul
echo ÿ

%2\NETWORK\AskUser YN Will NetBios be used (needed with IBM PC LAN program for example) (Y/N) ? 
if errorlevel 1 goto NoNetBios

if not exist %1\DXMA0MOD.SYS goto LanSIns
if     exist %1\DXMT0MOD.SYS goto LanSupOK
:LanSIns
echo Insert IBM Lan Support Program diskette in drive %1 and hit a key
pause >nul
:LanSupTry
if not exist %1\DXMA0MOD.SYS goto LanSupBad
if     exist %1\DXMT0MOD.SYS goto LanSupOK

:LanSupBad
echo	Unable to locate IBM Lan Support Program file(s).
echo	Insert IBM Lan Support Program diskette in drive %1 and hit a key to retry,
echo	Ctrl/C to abort installation.
pause >nul
goto LanSupTry

:LanSupOK
echo Copying Interrupt 5C Arbitrator DXMA0MOD.SYS.
echo The Interrupt 5C Arbitrator is a 'traffic cop' directing requests from
echo applications to the proper driver module. This allows multiple DLC and
echo NetBios drivers to coexist.
copy %1\DXMA0MOD.SYS %2\NETWORK >nul
echo Copying NetBios driver DXMT0MOD.SYS . .
copy %1\DXMT0MOD.SYS %2\NETWORK >nul
if not exist %1\DXMMSG.001 goto NoMSG
echo Installing English messages for NetBios driver.
copy %1\DXMMSG.001 %2\NETWORK\DXM.MSG >nul
:NoMSG
echo ÿ

%2\NETWORK\AskUser YN Shall "DEVICE= " lines be added to %2\CONFIG.SYS automatically (Y/N) ? 
if errorlevel 1 goto NoConf1

if not exist %2\CONFIG.SYS goto NoCfg1
echo Making backup copy of %2\CONFIG.SYS. The backup is named CONFIG.ORG . .
copy %2\CONFIG.SYS %2\CONFIG.ORG >nul
:NoCfg1
echo Appending lines to %2\CONFIG.SYS . .
echo DEVICE = %2\NETWORK\DXMA0MOD.SYS >> %2\CONFIG.SYS
echo DEVICE = %2\NETWORK\DT02DLC.SYS  >> %2\CONFIG.SYS
echo DEVICE = %2\NETWORK\DXMT0MOD.SYS >> %2\CONFIG.SYS
echo %2\CONFIG.SYS has been updated.
goto DoneOK

:NoConf1
echo ÿ
echo Make sure your CONFIG.SYS contains the lines:
echo DEVICE = %2\NETWORK\DXMA0MOD.SYS (optional country code)
echo DEVICE = %2\NETWORK\DT02DLC.SYS  (optional parameters)
echo DEVICE = %2\NETWORK\DXMT0MOD.SYS (optional parameters)
goto DoneOK

:NoNetBios
echo Copying Interrupt 5C Arbitrator DT01IA.SYS.
echo The Interrupt 5C Arbitrator is a 'traffic cop' directing requests from
echo applications to the proper driver module. This allows multiple DLC and
echo NetBios drivers to coexist.
copy %1\IBM\DOS\DT01IA.SYS %2\NETWORK >nul
echo ÿ
%2\NETWORK\AskUser YN Shall "DEVICE= " lines be added to %2\CONFIG.SYS automatically (Y/N) ? 
if errorlevel 1 goto NoConf2

if not exist %2\CONFIG.SYS goto NoCfg2
echo Making backup copy of %2\CONFIG.SYS. The backup is named CONFIG.ORG . .
copy %2\CONFIG.SYS %2\CONFIG.ORG >nul
:NoCfg2
echo Appending lines to %2\CONFIG.SYS . .
echo DEVICE = %2\NETWORK\DT01IA.SYS >> %2\CONFIG.SYS
echo DEVICE = %2\NETWORK\DT02DLC.SYS >> %2\CONFIG.SYS
echo %2\CONFIG.SYS has been updated.
goto DoneOK

:NoConf2
echo ÿ
echo Make sure your CONFIG.SYS contains the lines:
echo DEVICE = %2\NETWORK\DT01IA.SYS  (optional country code)
echo DEVICE = %2\NETWORK\DT02DLC.SYS (optional parameters)

:DoneOK
if exist %1\IBM\DOS\INSTIBM.BAT goto DelOK
echo Insert driver diskette in drive %1 and press a key
pause >nul
goto DoneOK

:DelOK
%1\IBM\DOS\INSTIBM %1 %2 CleanUp

:CleanUp
del %2\NETWORK\ASKUSER.COM >nul
del %2\NETWORK\INSTIBM.BAT >nul
echo ÿ
echo Installation is complete. The machine must be rebooted to load the drivers.
:Done
echo ÿ

