home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
cidlan.zip
/
DRIVERS.CMD
Wrap
OS/2 REXX Batch file
|
1994-04-23
|
11KB
|
206 lines
/***************************************************************************/
/* DRIVERS.CMD */
/* */
/* CID installation of LAN drivers and protocols not included with NTS/2 */
/* */
/* Using this command file eliminates the need to add your LAN adapter */
/* .NIF files and drivers to the NTS/2 MACS.ZIP and PROTOCOL.ZIP files. */
/* */
/* Install this command file by copying it to your \CID\EXE subdirectory. */
/* Then create the following directory structure in \CID\IMG: */
/* MD \CID\IMG\DRIVERS └─DRIVERS */
/* MD \CID\IMG\DRIVERS\MACS ├─MACS */
/* MD \CID\IMG\DRIVERS\PROTOCOL ├─PROTOCOL */
/* MD \CID\IMG\DRIVERS\ROOT └─ROOT */
/* Copy any LAN adapter .NIF files and drivers, such as ELNK3.NIF and */
/* ELNK3.OS2 to the \CID\IMG\DRIVERS\MACS subdirectory. Copy any protocol */
/* .NIF files and drivers, such as ODI2NDI.NIF and ODI2NDI.OS2, to the */
/* \CID\IMG\DRIVERS\PROTOCOL subdirectory. Copy any files which must be */
/* located in the root directory, such as EAGLEMAC.BIN for a Thomas-Conrad */
/* Token-Ring adapter, to the \CID\IMG\DRIVERS\ROOT subdirectory. If you */
/* have no files for the root directory, the COPY command for the ROOT */
/* directory should be deleted from this command file (below). */
/* */
/* You also need to create a "response file" which simply contains one */
/* DEVICE= line which is to be appended to the client's CONFIG.SYS file: */
/* DEVICE=C:\IBMCOM\MACS\driver.OS2 */
/* */
/* DRIVERS.CMD must be added to CASBASIC.FIL, so that the LAN adapter */
/* drivers will be installed as part of the CID install process. Add the */
/* following line in the ":vars" section at the beginning of CASBASIC.FIL: */
/* exepath=x:\exe /* This is where all the CID .CMD files are */ */
/* Add the following lines after LAPS /E:PREP but before the two THINIFS */
/* commands in the first group of install commands (OVERALL_STATE = 0): */
/* "exepath"\drivers "client" */
/* "bootdrive" */
/* x:\log + */
/* Add the following lines after LAPS /E:MAINT but before the two THINIFS */
/* commands in the second group of install commands (OVERALL_STATE = 1): */
/* "exepath"\drivers "client" */
/* "bootdrive" */
/* l: + */
/* */
/* Next, use the updated CASBASIC.FIL as input to the CASPREP command to */
/* create a .CMD file for the installation of all required products. */
/* */
/* Before starting a CID service update, it is a good idea to issue the */
/* following COPY commands, so that critical files may be easily restored: */
/* COPY d:\CONFIG.SYS d:\OS2\INSTALL */
/* COPY d:\STARTUP.CMD d:\OS2\INSTALL */
/* COPY d:\OS2\OS2*.INI d:\OS2\INSTALL */
/* */
/* The driver installation is designed such that the drivers for all types */
/* of adapters are installed on every system, for the sake of consistency. */
/* Alternatively, the name of the driver to be installed could be passed */
/* as a parameter so that only the necessary drivers are installed on each */
/* system. In this case, the DEVICE= line which is added to CONFIG.SYS */
/* could be generated automatically, eliminating the response file. */
/* */
/* Please send any comments or questions via e-mail to Robert Simpson at */
/* CompuServe 71520,737, IBMMAIL(USN6NB6N), or Internet address */
/* usn6nb6n@ibmmail.com. */
/***************************************************************************/
/* Here is a sample of the directory structure used by this command file: */
/* */
/* The volume label in drive X is OS2. */
/* */
/* Directory of X:\img\drivers */
/* */
/* 2-28-94 4:32p <DIR> 0 . */
/* 2-28-94 4:32p <DIR> 0 .. */
/* 2-28-94 4:32p <DIR> 465 macs */
/* 2-28-94 4:32p <DIR> 0 protocol */
/* 2-28-94 4:32p <DIR> 313 root */
/* 5 file(s) 0 bytes used */
/* */
/* Directory of X:\img\drivers\macs */
/* */
/* 2-28-94 4:32p <DIR> 0 . */
/* 2-28-94 4:32p <DIR> 0 .. */
/* 2-04-93 5:36p 1041 0 EL3IBMO2.NIF */
/* 2-14-93 12:31p 22911 0 ELNK3.OS2 */
/* 5-12-92 3:33p 10337 0 EXP16.OS2 */
/* 2-12-92 11:49a 3971 0 OLITOK.NIF */
/* 1-30-92 5:30a 16750 0 OLITOK.OS2 */
/* 10-27-93 3:57p 2702 0 TCCTOK.NIF */
/* 10-27-93 1:38p 13999 0 TCCTOK.OS2 */
/* 9 file(s) 71711 bytes used */
/* */
/* Directory of X:\img\drivers\protocol */
/* */
/* 2-28-94 4:32p <DIR> 0 . */
/* 2-28-94 4:32p <DIR> 0 .. */
/* 8-05-93 10:21a 31935 0 IFNDIS.SYS */
/* 8-05-93 10:20a 99631 0 INET.SYS */
/* 8-27-92 11:36a 2592 0 ODI2NDI.NIF */
/* 9-15-92 3:57p 18484 0 ODI2NDI.OS2 */
/* 7-26-93 3:30p 142 0 TCPIP.NIF */
/* 7 file(s) 152784 bytes used */
/* */
/* Directory of X:\img\drivers\root */
/* */
/* 2-28-94 4:32p <DIR> 0 . */
/* 2-28-94 4:32p <DIR> 0 .. */
/* 8-24-93 12:55a 26880 0 EAGLEMAC.BIN */
/* 3 file(s) 26880 bytes used */
/***************************************************************************/
parse ARG client bootdrive logfile additional
"@echo off"
/* Determine whether drivers has already been executed */
state = value("CAS_DRIVERS",,"OS2ENVIRONMENT")
if state == '' then do
say "No CAS_DRIVERS in environment."
end /* Do */
else do
say "CAS_DRIVERS="state
end /* Do */
/* Set good return code */
exitrc = x2d(FE00)
/* Make sure the client name was specified */
if client = '' then do
"echo ["date('u') time()"] Client name was not specified >>drivers.log"
exit x2d(1600)
end /* Do */
/* Display default values */
if logfile = '' then do
logfile = client".log"
"echo ["date('u') time()"] Log file parameter missing," logfile "was used >>"logfile
end /* Do */
if bootdrive = '' then do
"echo ["date('u') time()"] Boot drive parameter missing, current drive was used >>"logfile
end /* Do */
/* Begin installation */
"echo ["date('u') time()"] Installation of drivers begins... >>"logfile
"echo ["date('u') time()"] client="client ">>"logfile
if bootdrive = '' then
"echo ["date('u') time()"] bootdrive="substr(directory(),1,2) ">>"logfile
else
"echo ["date('u') time()"] bootdrive="bootdrive ">>"logfile
"echo ["date('u') time()"] logfile="logfile ">>"logfile
/* Copy the MAC and protocol drivers */
"echo ["date('u') time()"] Copying ROOT drivers to client's hard disk >>"logfile
"copy x:\img\drivers\root\*.* "bootdrive"\ 2>>"logfile
copyrc = rc
if copyrc <> 0 then do
"echo ["date('u') time()"] Copy failed with return code" copyrc ">>"logfile
exitrc = x2d(FE04)
end /* Do */
"echo ["date('u') time()"] Copying MACS drivers to client's hard disk >>"logfile
"copy x:\img\drivers\macs\*.* "bootdrive"\ibmcom\macs 2>>"logfile
copyrc = rc
if copyrc <> 0 then do
"echo ["date('u') time()"] Copy failed with return code" copyrc ">>"logfile
exitrc = x2d(0812)
end /* Do */
"echo ["date('u') time()"] Copying PROTOCOL drivers to client's hard disk >>"logfile
"copy x:\img\drivers\protocol\*.* "bootdrive"\ibmcom\protocol 2>>"logfile
if copyrc <> 0 then do
"echo ["date('u') time()"] Copy failed with return code" copyrc ">>"logfile
exitrc = x2d(0812)
end /* Do */
/* Make sure the response file exists */
rspfile = "x:\rsp\drivers\"client".rsp"
if stream(rspfile,'c','query exists') == '' then do
"echo ["date('u') time()"] Response file" rspfile "does not exist >>"logfile
exit x2d(0800)
end /* Do */
/* Add the driver to CONFIG.SYS */
"echo ["date('u') time()"] Appending "client".RSP to "bootdrive"\CONFIG.SYS >>"logfile
"copy "bootdrive"\CONFIG.SYS+x:\rsp\drivers\"client".rsp "bootdrive"\CONFIG.SYS 2>>"logfile
if copyrc <> 0 then do
"echo ["date('u') time()"] Copy failed with return code" copyrc ">>"logfile
exitrc = x2d(0812)
end /* Do */
/* Indicate successful install */
"echo ["date('u') time()"] Installation of drivers completed with rc="exitrc ">>"logfile
exit exitrc