home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Professional
/
OS2PRO194.ISO
/
os2
/
network
/
lcf103
/
install.cmd
next >
Wrap
OS/2 REXX Batch file
|
1994-01-06
|
110KB
|
3,269 lines
/*--------------------------------------------------------------------*/
/* */
/* Purpose: */
/* -------- */
/* */
/* To install the LCF Code Server on a system. */
/* */
/* Version: */
/* -------- */
/* */
/* This command file will handle V1R1L003. */
/* */
/* Description: */
/* ----------- */
/* */
/* This REXX command file REQUIRES OS/2 2.0 or later. */
/* */
/* Usage: */
/* ------ */
/* */
/* INSTALL */
/* */
/* This file has no parameters, all required information is */
/* solicited from the user as needed. */
/* */
/* Note: */
/* ----- */
/* */
/* If you are installing the OS/2 licensed material from a */
/* CD-ROM which is not presented as a selection choice on the */
/* menu when action 4 is run, then modify the following two */
/* lines to match your CD-ROM's label and directory prefix: */
/* */
cdromlabel = OS2_CD_ROM
cdsubdir = OS2SE21
/* For example, when loading OS/2 material from an international */
/* CD-ROM which contains versions of OS/2 for several languages */
/* the following line would be used to load the German version */
/* (country code 049): */
/* */
/* cdsubdir = OS221_049 */
/* */
/* Rexx Coding Conventions: */
/* ------------------------ */
/* */
/* Reserved REXX names are uppercase, like IF and THEN. */
/* */
/* Function names have the first letter uppercase. */
/* */
/* Variables are lowercase. */
/* */
/* */
/* (C) 1993-94 ForeFront Software Inc. All rights reserved. */
/* */
/*--------------------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* Initialization. */
/*--------------------------------------------------------------------*/
/* TRACE ?R */
relName = 'LCF 1.1'
bundleName = 'V1R1L003'
trialDays = 30
trialAccess = 1
trialCsName = 'OS2BENCH'
defTrialDays = trialDays
nbOption = 0
floppy = 0
cdrom = 0
osver = 0
log = '>>NUL'
CALL Rxfuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
CALL Sysloadfuncs
rc = SETLOCAL()
env = 'OS2ENVIRONMENT'
errfile = 'FALSE'
SIGNAL on ERROR
SIGNAL on FAILURE
SIGNAL on HALT
currdir = Directory()
'@ECHO OFF'
'MODE CO80,43'
'@ECHO ON'
/*--------------------------------------------------------------------*/
/* Analyse any parameters we were passed. */
/*--------------------------------------------------------------------*/
PARSE UPPER ARG parm1 .
IF parm1 <> '' THEN DO
IF parm1 = '/H' THEN SIGNAL ENDHELP
IF parm1 = '/?' THEN SIGNAL ENDHELP
IF parm1 = '?' THEN SIGNAL ENDHELP
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ERROR: This INSTALL command file does not accept parameters ║'
SAY '║ on the command line other than /? or /H. Re-enter the ║'
SAY '║ command without any parameters. It will prompt for all ║'
SAY '║ required input. ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY
SIGNAL ENDERROR
END
/*--------------------------------------------------------------------*/
/* Ensure OS/2 2.xx is being run. */
/*--------------------------------------------------------------------*/
os2ver = SysOS2Ver()
IF Substr( os2ver, 1, 1 ) <> '2' THEN DO
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ERROR: LCF installation requires OS/2 Version 2.0 or higher. ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SIGNAL ENDERROR
END
/*--------------------------------------------------------------------*/
/* If we are being run from a diskette then save the drive name */
/* for possible future use. */
/*--------------------------------------------------------------------*/
inDrive = Filespec( 'Drive', currdir )
IF inDrive == 'A:' | inDrive == 'B:' THEN
floppy = inDrive
/*--------------------------------------------------------------------*/
/* Present a list of install actions and ask which is required. */
/*--------------------------------------------------------------------*/
ACTIONS:
IF destination <> "DESTINATION" THEN /* Since entry drive not */
dir = Directory( destination ) /* always equal to dest drive */
dir = Directory(currdir)
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ Indicate from the list below which installation action you ║'
SAY '║ want performed. ║'
SAY '║ ║'
SAY '║ You must eventually perform all the non-optional actions. ║'
SAY '║ Actions should be performed in numeric order. ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ ACTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ View the LCF READ.ME file. ║'
SAY '║ │ ║'
SAY '║ 2 │ Unload LCF product from the distribution ║'
SAY '║ │ diskette. ║'
SAY '║ │ ║'
SAY '║ 3 │ Set up LCF folder and icons on Desktop. ║'
SAY '║ │ ║'
SAY '║ 4 │ Load OS/2 Licensed Material. ║'
SAY '║ │ ║'
SAY '║ 5 │ Load LAN Licensed Material. ║'
SAY '║ │ ║'
SAY '║ 6 │ Create Mini-OS/2 package to install later. ║'
SAY '║ │ (Optional) ║'
SAY '║ │ ║'
SAY '║ 7 │ Authorize the LCF to run. ║'
SAY '║ │ ║'
SAY '║ X │ Exit this installation program. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter ACTION and press enter:'
PULL key
'@ECHO *' log
'@ECHO Action 'key' selected 'Date()' 'Time() log
SELECT
WHEN key == 'X' THEN
SIGNAL DONE
WHEN key == 1 THEN
SIGNAL README
WHEN key == 2 THEN
SIGNAL UNLOAD
WHEN key == 3 THEN
SIGNAL FOLDER
WHEN key == 4 THEN
SIGNAL LOADOS2
WHEN key == 5 THEN
SIGNAL LOADLAN
WHEN key == 6 THEN
SIGNAL MINIOS2
WHEN key == 7 THEN
SIGNAL AUTHLCF
OTHERWISE DO
SAY
SAY 'Invalid action selected.'
Call PAUSEMSG
SIGNAL ACTIONS
END
END
/**********************************************************************/
/* The code to handle each of the above actions now follows */
/**********************************************************************/
/*--------------------------------------------------------------------*/
/* ACTION 1: Invoke the View facility to allow reading of the */
/* READ.ME file. */
/*--------------------------------------------------------------------*/
README:
IF Stream('README.INF', 'c', 'query exists') == '' THEN DO
IF Stream('..\DOC\README.INF', 'c', 'query exists') == '' THEN DO
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ ERROR: You cannot view the README.INF file from this option ║'
SAY '║ if the INSTALL command was not started with the ║'
SAY '║ current directory set to the LCF installation ║'
SAY '║ diskette or the \LCF\REXX directory. ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
CALL PAUSEMSG
END
ELSE
'VIEW ..\DOC\README.INF'
END
ELSE
'VIEW README.INF' /* view from current directory */
/* note, diskette must not be write protected, view updates INF file */
SIGNAL ACTIONS
/*--------------------------------------------------------------------*/
/* ACTION 2: Unload the LCF product from the distribution diskette. */
/*--------------------------------------------------------------------*/
/* First, prompt the user to enter the target directory. */
/*--------------------------------------------------------------------*/
UNLOAD:
CALL GETDESTINATION
/*--------------------------------------------------------------------*/
/* If the destination directory does not exist, then create it. */
/* This eliminates the question from XCOPY if the destination is a */
/* directory or file. */
/*--------------------------------------------------------------------*/
newdir = Directory( destination )
IF newdir <> destination THEN DO
rc = PATHMK( destination )
IF rc <> 0 THEN DO
SAY
SAY 'Error: Unable to create directory 'destination'.'
CALL PAUSEMSG
SIGNAL ACTIONS
END
END
ELSE DO
WARNLOOP:
CALL SysCls
pos = SysCurPos( 0, 0 )
i = 15 - Length(destination)
IF i < 0 THEN i = 0
blks = Substr(' ', 1, i, ' ')
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ WARNING ║'
SAY '║ ║'
SAY '║ 'destination' ALREADY EXISTS! 'blks' ║'
SAY '║ ║'
SAY '║ Any modifications you have made to LCF distributed scripts ║'
SAY '║ or model configuration files will be OVERWRITTEN. ║'
SAY '║ ║'
SAY '║ If you want to stop this command to take a backup of your ║'
SAY '║ changes enter X now. Enter C to continue with the install. ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter X or C now and press enter:'
PULL ans
IF ans = 'X' THEN SIGNAL DONE
IF ans <> 'C' THEN SIGNAL WARNLOOP
END
log = '>>'destination'\install.log'
'@ECHO *' log
'@ECHO **************************************************************'log
'@ECHO Unloading LCF 'bundleName' 'Date()' 'Time() log
'@ECHO GetDest: OS/2 = 'SysOS2Ver()' 'log
'@ECHO destination = 'destination' 'log
'@ECHO Entry directory = 'currdir' 'log
dir = Directory( currdir ) /* restore entry directory */
IF Stream(bundleName'.DAT', 'c', 'query exists') == '' THEN DO
'@ECHO Error: 'bundleName'.DAT not found in 'currdir' 'log
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ ERROR: You cannot run the UNLOAD action if the 'bundlename'.DAT ║'
SAY '║ file is not in the current directory when the install ║'
SAY '║ command was issued. ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
CALL PAUSEMSG
SIGNAL ACTIONS
END
/*--------------------------------------------------------------------*/
/* Ask which NetBios support is required. */
/*--------------------------------------------------------------------*/
rc = GETNBOPTION()
IF rc <> 0 THEN
SIGNAL ACTIONS
/*--------------------------------------------------------------------*/
/* Copy the LCF bundle file and README to the hard disk. */
/*--------------------------------------------------------------------*/
SAY
SAY 'Copying LCF bundle file. This will take a few seconds...'
'@ECHO OFF'
'XCOPY 'bundleName'.DAT 'destination'\*.EXE 'log
'@ECHO ON'
/*--------------------------------------------------------------------*/
/* Decompress the self-exploding bundle with LH/2 */
/*--------------------------------------------------------------------*/
newdir = Directory( destination ) /* Change to new LCF directory */
SAY
SAY 'Decompressing LCF files...'
'@ECHO OFF'
bundleName'.EXE /o' log /* Run the self-exploding file */
'DEL 'bundleName'.EXE' log /* Cleanup bundle */
'@ECHO ON'
'@ECHO 'bundleName'.EXE deleted 'log
/*--------------------------------------------------------------------*/
/* Copy some of the files around to other directories. */
/*--------------------------------------------------------------------*/
SAY
SAY 'Setting up Boot Strap directories...'
'@ECHO OFF'
IF nbOption = 1 | nbOption = 3 THEN
'XCOPY BIN\CLIENT\LCF.EXE BOOTSTRP\*.* 'log
IF nbOption = 2 | nbOption = 3 THEN
'XCOPY BIN\CLIENT\LCFI.EXE BOOTSTRP\*.* 'log
'XCOPY BIN\UTILS\LCFBOOT.EXE BOOTSTRP\*.* 'log
'XCOPY BIN\UTILS\LCFDIRSR.EXE BOOTSTRP\*.* 'log
'XCOPY BOOTSTRP\*.* BOOTST21\*.* /s /e 'log
/*--------------------------------------------------------------------*/
/* Copy the INSTALL command and ReadMe.INF file to the LCF dir's. */
/*--------------------------------------------------------------------*/
/* Strip \ which is sometimes at end of directory name to handle
both the c:\ and c:\xxx cases. */
tempdir = Strip(currdir, 'T', '\')
IF Stream(tempdir'\README.INF', 'c', 'query exists') <> '' THEN
'XCOPY 'tempdir'\README.INF DOC\*.* 'log
IF Stream(tempdir'\INSTALL.CMD', 'c', 'query exists') <> '' THEN
'XCOPY 'tempdir'\INSTALL.CMD REXX\*.* 'log
'@ECHO ON'
dir = Directory( currdir ) /* restore entry directory */
SIGNAL ACTIONS
/*--------------------------------------------------------------------*/
/* ACTION 3: Create the LCF folder. */
/*--------------------------------------------------------------------*/
FOLDER:
rc = CHECKDESTINATION()
IF rc <> 0 THEN SIGNAL ACTIONS
IF nbOption = 0 THEN DO
rc = GETNBOPTION()
IF rc <> 0 THEN
SIGNAL ACTIONS
END
CALL SysCls
pos = SysCurPos( 0, 0 )
IF Substr( SysOS2Ver(), 3, 1 ) == '0' THEN DO
SAY
SAY 'Warning: The LCF folder may not be placed on the Desktop'
SAY ' if the service pack (XR6055) has not been installed'
SAY ' on this machine.'
CALL PAUSEMSG
END
SAY
SAY 'Creating LCF folder on DESKTOP, please wait...'
setupstring = 'OBJECTID=<LCF100>;' || ,
'MINWIN=DESKTOP;' || ,
'CCVIEW=NO;' || ,
'RESTRICTION=NOPRINT;'
result = SysCreateObject( 'WPFolder', relName, '<WP_DESKTOP>', ,
setupstring, 'REPLACE' )
IF result \= '1' THEN DO
SAY
SAY 'Error: Unable to create LCF folder on Desktop.'
CALL PAUSEMSG
SIGNAL ACTIONS
END
SAY
SAY 'Placing LCF Server ICON in LCF folder...'
IF nbOption = 1 | nbOption = 3 THEN DO
setupstring = 'EXENAME=' || ,
destination || ,
'\BIN\SERVER\LCFSERV.EXE;' || ,
'PARAMETERS=OS2BENCH 1 ' || ,
destination || ,
'\LOG\;' || ,
'STARTUPDIR=' || ,
destination || ,
'\LOG\;'
result = SysCreateObject( 'WPProgram', 'LCF Server', '<LCF100>', ,
setupstring, 'REPLACE' )
IF result \= '1' THEN DO
SAY
SAY 'Error: Unable to create LCF Server program in LCF folder.'
CALL PAUSEMSG
SIGNAL ACTIONS
END
END
IF nbOption = 2 | nbOption = 3 THEN DO
setupstring = 'EXENAME=' || ,
destination || ,
'\BIN\SERVER\LCFSERVI.EXE;' || ,
'PARAMETERS=OS2BENCH 1 ' || ,
destination || ,
'\LOG\;' || ,
'STARTUPDIR=' || ,
destination || ,
'\LOG\;'
result = SysCreateObject( 'WPProgram', 'LCF IPX Server', '<LCF100>', ,
setupstring, 'REPLACE' )
IF result \= '1' THEN DO
SAY
SAY 'Error: Unable to create IPX LCF Server program in LCF folder.'
CALL PAUSEMSG
SIGNAL ACTIONS
END
END
setupstring = 'EXENAME=VIEW.EXE;' || ,
'PARAMETERS=' || ,
destination || ,
'\DOC\LCFDOC.INF;'
result = SysCreateObject( 'WPProgram', 'LCF Manual', ,
'<LCF100>', setupstring, 'REPLACE' )
IF result \= '1' THEN DO
SAY
SAY "Error: Unable to create View for LCF Manual."
CALL PAUSEMSG
SIGNAL ACTIONS
END
setupstring = 'EXENAME=VIEW.EXE;' || ,
'PARAMETERS=' || ,
destination || ,
'\DOC\README.INF;'
result = SysCreateObject( 'WPProgram', 'LCF ReadMe', ,
'<LCF100>', setupstring, 'REPLACE' )
IF result \= '1' THEN DO
SAY
SAY 'Error: Unable to create View for LCF ReadMe File.'
CALL PAUSEMSG
SIGNAL ACTIONS
END
SIGNAL ACTIONS
/*--------------------------------------------------------------------*/
/* ACTION 4: Load OS/2 Licensed Material into LCF directories. */
/*--------------------------------------------------------------------*/
LOADOS2:
rc = CHECKDESTINATION()
IF rc <> 0 THEN SIGNAL ACTIONS
os2OptionLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT OS/2 System to be loaded ║'
SAY '║ ║'
SAY '║ This will only load files from your OS/2 distribution package ║'
SAY '║ which the LCF needs to later install that version of OS/2. It ║'
SAY '║ does not load a complete OS/2 system. ║'
SAY '║ ║'
SAY '║ You need to perform this action once for each release of OS/2 ║'
SAY '║ you will want to install with the LCF. ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 0 │ OS/2 2.0 ║'
SAY '║ │ ║'
SAY '║ 1 │ OS/2 2.1 ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL os2Option
'@ECHO Action 4: 'os2Option' selected' log
SAY
SELECT
WHEN os2Option = 0 THEN
CALL LOADOS20
WHEN os2Option = 1 THEN
rc = LOADOS21()
WHEN os2Option = 'X' THEN DO
SIGNAL ACTIONS
END
OTHERWISE
DO
SAY 'Invalid option selected.'
CALL PAUSEMSG
SIGNAL os2OptionLoop
END
END /* of SELECT */
SIGNAL ACTIONS
/*-----------------------------------------------------------------------*/
/* ACTION 5: Load LAN Requester Licensed Material into LCF directories. */
/*-----------------------------------------------------------------------*/
LOADLAN:
rc = CHECKDESTINATION()
IF rc <> 0 THEN SIGNAL ACTIONS
loadLanOptionLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT LAN Requester ║'
SAY '║ ║'
SAY '║ This will load files from your LAN requester package which ║'
SAY '║ the LCF needs to later install the requester on target ║'
SAY '║ workstations and for use with the LCF seed diskette system. ║'
SAY '║ ║'
SAY '║ You need to perform this action once for each release of OS/2 ║'
SAY '║ you will want to install with the LCF. ║'
SAY '║ ║'
SAY '║ Any requester not listed in the selection list below can be ║'
SAY "║ easily added manually. Consult the Administrator's manual ║"
SAY '║ (Chapter 2) for instructions on how to do this. ║'
SAY '║ ║'
SAY '║ Lan Server 2.0 and 3.0 are mutually exclusive because our ║'
SAY '║ directory structure loads both into the same target ║'
SAY '║ directories. ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ NetWare ║'
SAY '║ │ ║'
SAY '║ 2 │ LAN Server 2.0 ║'
SAY '║ │ ║'
SAY '║ 3 │ LAN Server 3.0 ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL lanOption
'@ECHO Action 5: 'lanOption' selected' log
SAY
SELECT
WHEN lanOption = 1 THEN
CALL LOADNETWARE
WHEN lanOption = 2 THEN
CALL LOADLS2
WHEN lanOption = 3 THEN
CALL LOADLS3
WHEN lanOption = 'X' THEN DO
SIGNAL ACTIONS
END
OTHERWISE
DO
SAY 'Invalid option selected.'
CALL PAUSEMSG
SIGNAL loadLanOptionLoop
END
END /* of SELECT */
SIGNAL ACTIONS
/*-----------------------------------------------------------------------*/
/* ACTION 6: Create a Mini-OS/2 image for later installation via LCF. */
/*-----------------------------------------------------------------------*/
MINIOS2:
rc = CHECKDESTINATION()
IF rc <> 0 THEN SIGNAL ACTIONS
miniOptionLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ Create Mini-OS/2 Package ║'
SAY '║ ║'
SAY '║ This procedure will create an LCF package for a Mini-OS/2 ║'
SAY '║ system. This package can then be used to install the ║'
SAY '║ Mini-OS/2 on a target workstation by using the MINIOS2.SCR ║'
SAY '║ script. ║'
SAY '║ ║'
SAY '║ The package is created from the OS/2 system this command is ║'
SAY '║ run on. This determines the OS/2 release the package will ║'
SAY '║ contains. ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ Continue with Mini-OS/2 package creation. ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL miniOption
'@ECHO Action 6: 'miniOption' selected' log
SAY
SELECT
WHEN miniOption = 1 THEN
CALL CREATEMINI
WHEN miniOption = 'X' THEN DO
SIGNAL ACTIONS
END
OTHERWISE
DO
SAY 'Invalid option selected.'
CALL PAUSEMSG
SIGNAL miniOptionLoop
END
END /* of SELECT */
SIGNAL ACTIONS
/*-----------------------------------------------------------------------*/
/* ACTION 7: Authorize an LCF trial or production system. */
/*-----------------------------------------------------------------------*/
AUTHLCF:
rc = CHECKDESTINATION()
IF rc <> 0 THEN SIGNAL ACTIONS
authOptionLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ Authorize LCF to Run ║'
SAY '║ ║'
SAY '║ This procedure will authorize the LCF as a trial or ║'
SAY '║ production system. ║'
SAY '║ ║'
SAY '║ This procedure will prompt you for customer specific ║'
SAY '║ information and then ask you to contact ForeFront Software ║'
SAY '║ for an authorization key which must then be entered as a part ║'
SAY '║ of this procedure. ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ Authorize the LCF for a trial. ║'
SAY '║ │ ║'
SAY '║ 2 │ Authorize the LCF for production. ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL authOption
'@ECHO Action 7: 'authOption' selected' log
SAY
SELECT
WHEN authOption = 1 THEN
CALL AUTHTRIAL
WHEN authOption = 2 THEN
CALL AUTHPROD
WHEN authOption = 'X' THEN DO
SIGNAL ACTIONS
END
OTHERWISE
DO
SAY 'Invalid option selected.'
CALL PAUSEMSG
SIGNAL authOptionLoop
END
END /* of SELECT */
SIGNAL ACTIONS
/*--------------------------------------------------------------------*/
/* End of CMD. */
/*--------------------------------------------------------------------*/
DONE:
rc = ENDLOCAL()
SAY
SAY 'INSTALL program completed.'
IF destination <> "DESTINATION" THEN DO
SAY
SAY
SAY destination'\INSTALL.LOG is the install audit log.'
SAY
dir = Directory( destination )
END
dir = Directory( currdir ) /* maybe different drive */
EXIT
PAUSEMSG:
SAY
SAY 'Press any key to continue.'
anykey = SysGetKey( 'NOECHO' )
RETURN
ERROR:
rcErr = rc
SAY
SAY 'ERROR 'rcErr': 'Errortext(rcErr)
SAY 'Line 'sigl': 'Sourceline(sigl)
SAY 'INSTALL failed...'
'@ECHO ERROR 'rcErr': 'Errortext(rcErr) log
'@ECHO Line 'sigl': 'Sourceline(sigl) log
'@ECHO INSTALL failed...'log
SIGNAL ENDERROR
FAILURE:
rcErr = rc
SAY
SAY 'FAILURE 'rcErr': 'Errortext(rcErr)
SAY 'Line 'sigl': 'Sourceline(sigl)
SAY 'INSTALL failed...'
'@ECHO ERROR 'rcErr': 'Errortext(rcErr) log
'@ECHO Line 'sigl': 'Sourceline(sigl) log
'@ECHO INSTALL failed...'log
SIGNAL ENDERROR
HALT:
SAY 'HALT condition raised.'
'@ECHO HALT condition raised (CONTROL-BREAK) while in line 'sigl log
SIGNAL ENDERROR
ENDERROR:
IF destination <> "DESTINATION" THEN DO
SAY
SAY
SAY 'Look in 'destination'\INSTALL.LOG for the install audit log.'
SAY
dir = Directory( destination )
END
dir = Directory( currdir ) /* maybe different drive */
rc = ENDLOCAL()
EXIT
ENDHELP:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ LCF INSTALLATION PROGRAM ║'
SAY '╟────────────────────────────────────────────────────────────────╢'
SAY '║ ║'
SAY '║ This CMD file requires OS/2 2.00 or higher. ║'
SAY '║ ║'
SAY '║ To install LCF, you must change to the drive containing ║'
SAY '║ the LCF distribution diskette and type: ║'
SAY '║ ║'
SAY '║ INSTALL ║'
SAY '║ ║'
SAY '║ You will be prompted for all necessary parameters. ║'
SAY '║ ║'
SAY '║ To view the complete menus shown by this command file use ║'
SAY '║ an OS/2 Full Screen session or use an OS/2 Window with a ║'
SAY '║ small font size. ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY
rc = ENDLOCAL()
EXIT
/**********************************************************************/
/* Local Subroutines. */
/* */
/* Do not use SIGNAL to get back to the mainline from these */
/* since this will clobber the mainline's variables */
/* */
/**********************************************************************/
/*--------------------------------------------------------------------*/
/* Ask which NetBios support is required. */
/*--------------------------------------------------------------------*/
GETNBOPTION: PROCEDURE EXPOSE nbOption log /* Local Function */
inNbOption = nbOption
nbOptionLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT NetBIOS support you will use ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ IBM NetBIOS (Lan Server/Lan Manager). ║'
SAY '║ │ ║'
SAY '║ 2 │ Novell NetBios Simulator (over IPX). ║'
SAY '║ │ ║'
SAY "║ 3 │ Both of the above NetBIOS's. ║"
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL nbOption
'@ECHO GetNBoption: 'nbOption' selected' log
SAY
SELECT
WHEN nbOption = 1 THEN
SAY 'IBM NetBIOS selected'
WHEN nbOption = 2 THEN
SAY 'NetWare NetBios selected'
WHEN nbOption = 3 THEN
SAY "Both NetBIOS's selected"
WHEN nbOption = 'X' THEN DO
nbOption = inNbOption
RETURN 1
END
OTHERWISE
DO
nbOption = 0
SAY 'Invalid option selected.'
CALL PAUSEMSG
SIGNAL nbOptionLoop
END
END /* of SELECT */
RETURN 0 /* of GETNBOPTION */
/*--------------------------------------------------------------------*/
/* Determine the the directory where LCF will be installed. */
/*--------------------------------------------------------------------*/
GETDESTINATION: PROCEDURE EXPOSE destination log /* Local Function */
getDestLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ Indicate the drive and optional directory the LCF is to be ║'
SAY '║ or was installed on. ║'
SAY '║ ║'
SAY '║ The drive must be a valid drive letter followed by a colon. ║'
SAY '║ ║'
SAY '║ If a directory is not specified, the \LCF directory will be ║'
SAY '║ used as a default. If other than \LCF is used, some sample ║'
SAY '║ files will have to be modified before use. ║'
SAY '║ ║'
SAY '║ For example: ║'
SAY '║ C: ║'
SAY '║ ║'
SAY '║ will install to: ║'
SAY '║ ║'
SAY '║ C:\LCF ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter DRIVE and press enter:'
PULL dataline
PARSE UPPER VAR dataline parm1 .
SELECT
WHEN Length( parm1 ) < 2 THEN DO
SAY
SAY 'Error: "'parm1'" is not a valid drive.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
WHEN Length( parm1 ) == 2 THEN DO
IF Substr( parm1, 2, 1 ) <> ':' THEN DO
SAY
SAY 'Error: "'parm1'" is not a valid drive.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
END
OTHERWISE DO
IF Substr( parm1, 2, 2 ) <> ':\' THEN DO
SAY
SAY 'Error: "'parm1'" is not a valid drive.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
END
END
/*--------------------------------------------------------------------*/
/* Break the [destination] into a drive, path and name. The */
/* Filespec() function produces the following results: */
/* */
/* Drive Path Name */
/* ----- ------------ ------ */
/* \ "" "\" "" */
/* C "" "" "C" */
/* C\ "" "C\" "" */
/* C: "C:" "" "" */
/* C:\ "C:" "\" "" */
/* C:\LCF "C:" "\" "LCF" */
/* C:\LCF\ "C:" "\LCF\" "" */
/* C:\LCF\TEST "C:" "\LCF\" "TEST" */
/* C:\LCF\TEST\ "C:" "\LCF\TEST\" "" */
/* */
/* First strip any trailing '\'. */
/*--------------------------------------------------------------------*/
destination = Strip( parm1, 'T', '\' )
destdrive = Filespec( 'Drive', destination )
destpath = Filespec( 'Path', destination )
destname = Filespec( 'Name', destination )
IF Substr( destdrive, 2, 1 ) <> ':' THEN DO
SAY
SAY 'Error: "'parm1'" is not a valid drive.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
newdir = Directory( destdrive'\' )
IF newdir == destdrive'\' THEN dir = Directory( currdir )
ELSE DO
SAY
SAY 'Error: "'parm1'" is not a valid drive.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
IF ( destpath == '' ) & ( destname == '' ) THEN DO
destpath = '\'
destname = 'LCF'
END
IF ( destpath <> '\' ) | ( destname == '' ) THEN DO
SAY
SAY 'Error: "'parm1'" is not a valid destination directory.'
SAY ' Only 1 directory level allowed.'
CALL PAUSEMSG
SIGNAL getDestLoop
END
IF destname <> 'LCF' THEN DO
CONFIRM1LOOP:
CALL SysCls
pos = SysCurPos( 0, 0 )
i = 15 - Length(destname)
IF i < 0 THEN i = 0
blks = Substr(' ', 1, i, ' ')
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ WARNING ║'
SAY '║ ║'
SAY '║ The destination directory is not \LCF ║'
SAY '║ ║'
SAY '║ You will have to edit all scripts supplied by this ║'
SAY '║ installation to replace all occurances of \LCF with ║'
SAY '║ \'destname ''blks' ║'
SAY '║ ║'
SAY '║ Do you want to proceed with this destination directory? ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter Y/N:'
PULL ans
IF ans = 'Y' THEN SIGNAL DESTINATIONOK
IF ans = 'N' THEN SIGNAL getDestLoop
SIGNAL CONFIRM1LOOP
END
DESTINATIONOK:
destination = destdrive || destpath || destname
'@ECHO GetDest: OS/2 = 'SysOS2Ver()' 'log
'@ECHO destination = 'destination' 'log
RETURN /* end of GETDESTINATION */
/*--------------------------------------------------------------------*/
/* Check that the LCF destination directory exists. */
/*--------------------------------------------------------------------*/
CHECKDESTINATION: PROCEDURE EXPOSE destination log
IF destination = 'DESTINATION' THEN
CALL GETDESTINATION
saveDir = Directory( )
checkDir = Directory( destination )
IF checkDir <> destination THEN DO
SAY
SAY 'Error: Directory 'destination' does not exist.'
SAY ' You must invoke the "Unload LCF product" action to create it.'
saveDir = Directory( saveDir )
CALL PAUSEMSG
RETURN 1
END
IF log = '>>NUL' THEN
log = '>>'destination'\install.log'
saveDir = Directory( saveDir )
RETURN 0 /* end of CHECKDESTINATION */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.0 distribution media. */
/*--------------------------------------------------------------------*/
LOADOS20: PROCEDURE EXPOSE floppy destination osver log
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
osver = OS2200
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTSTRP'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTST21' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
rc = MOUNTDISK('DISK 0', 'IBM OS/2 2.0 Installation Diskette 41G8238')
'@ECHO OFF'
'XCOPY 'floppy'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'floppy'\*.BIO 'osVerDir'\DISK1\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 1', 'IBM OS/2 2.0 Diskette 1 41G8242')
'@ECHO OFF'
'XCOPY 'floppy'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 2', 'IBM OS/2 2.0 Diskette 2 84F8474')
'@ECHO OFF'
'UNPACK 'floppy'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'floppy'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\UHPFS.DLL 'bootstrp'\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 4', 'IBM OS/2 2.0 Diskette 4 84F8480')
'@ECHO OFF'
'UNPACK 'floppy'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 5', 'IBM OS/2 2.0 Diskette 5 84F8483')
'@ECHO OFF'
'UNPACK 'floppy'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 6', 'IBM OS/2 2.0 Diskette 6 84F8486')
'@ECHO OFF'
'UNPACK 'floppy'\REQUIRED 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 7', 'IBM OS/2 2.0 Diskette 7 84F8489')
'@ECHO OFF'
'UNPACK 'floppy'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'@ECHO ON'
RETURN /* end of LOADOS20 */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 distribution media. */
/*--------------------------------------------------------------------*/
LOADOS21: PROCEDURE EXPOSE floppy cdrom destination osver log cdsubdir ,
cdromlabel
get21MediaLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT OS/2 2.1 Media Format to be Used ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 1 │ OS/2 2.1 13 diskette system ║'
SAY '║ │ Salmon colored labels ║'
SAY '║ │ ║'
SAY '║ 2 │ OS/2 2.1 17 diskette system ║'
SAY '║ │ Blue colored labels ║'
SAY '║ │ ║'
SAY '║ 3 │ OS/2 2.1 for Windows (11 diskettes) ║'
SAY '║ │ Green colored labels ║'
SAY '║ │ ║'
SAY '║ 4 │ OS/2 2.1 CD with 13 diskette image ║'
SAY '║ │ Salmon colored labels ║'
SAY '║ │ ║'
SAY '║ 5 │ OS/2 2.1 CD with 17 diskette image ║'
SAY '║ │ Blue colored labels ║'
SAY '║ │ ║'
SAY '║ 6 │ OS/2 2.1 for Windows CD (11 diskette image) ║'
SAY '║ │ Green colored labels ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL mediaOption
'@ECHO LoadOS21: 'mediaOption' selected' log
SAY
SELECT
WHEN mediaOption = 1 THEN
CALL OS21DK13
WHEN mediaOption = 2 THEN
CALL OS21DK17
WHEN mediaOption = 3 THEN
CALL OS21DK11
WHEN mediaOption = 4 THEN
CALL OS21CD13
WHEN mediaOption = 5 THEN
CALL OS21CD17
WHEN mediaOption = 6 THEN
CALL OS21CD11
WHEN mediaOption = 'X' THEN
RETURN 1
OTHERWISE
DO
SAY 'Invalid media selected.'
CALL PAUSEMSG
SIGNAL get21MediaLoop
END
END /* of SELECT */
RETURN 0 /* end of LOADOS21 */
/*-----------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 for Windows (11 diskette media) */
/*-----------------------------------------------------------------------*/
OS21DK11: PROCEDURE EXPOSE floppy destination osver log
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
osver = OS2210
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
savedir = Directory()
destination = Directory( destination ) /* to copy unpack2.exe into */
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
rc = MOUNTDISK('DISK 1', 'IBM OS/2 2.1 Diskette 1')
'@ECHO OFF'
'XCOPY 'floppy'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
/* Note: we need UNPACK2 from disk 2 to handle DISK_0 bundle */
rc = MOUNTDISK('DISK 2', 'IBM OS/2 2.1 Diskette 2')
'@ECHO OFF'
'XCOPY 'floppy'\UNPACK2.EXE *.* 'log
'UNPACK2 'floppy'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'floppy'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\UHPFS.DLL 'bootstrp'\*.* 'log
'UNPACK2 'floppy'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 3', 'IBM OS/2 2.1 Diskette 3')
'@ECHO OFF'
'UNPACK2 'floppy'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 9', 'IBM OS/2 2.1 Diskette 9')
'@ECHO OFF'
'UNPACK2 'floppy'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 0', 'IBM OS/2 2.1 Installation Diskette')
'@ECHO OFF'
'XCOPY 'floppy'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'floppy'\*.BIO 'osVerDir'\DISK1\*.* 'log
'UNPACK2 'floppy'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'DEL UNPACK2.EXE 'log
'@ECHO ON'
savedir = Directory( savedir )
RETURN /* end of OS21DK11 */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 13 diskette media. */
/*--------------------------------------------------------------------*/
OS21DK13: PROCEDURE EXPOSE floppy destination osver log
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
osver = OS2210
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
savedir = Directory()
destination = Directory( destination ) /* to copy unpack2.exe into */
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
rc = MOUNTDISK('DISK 0', 'IBM OS/2 2.1 Installation Diskette')
'@ECHO OFF'
'XCOPY 'floppy'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'floppy'\*.BIO 'osVerDir'\DISK1\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 1', 'IBM OS/2 2.1 Diskette 1')
'@ECHO OFF'
'XCOPY 'floppy'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 2', 'IBM OS/2 2.1 Diskette 2')
'@ECHO OFF'
'XCOPY 'floppy'\UNPACK2.EXE *.* 'log
'UNPACK2 'floppy'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'floppy'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\UHPFS.DLL 'bootstrp'\*.* 'log
'UNPACK2 'floppy'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'UNPACK2 'floppy'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 3', 'IBM OS/2 2.1 Diskette 3')
'@ECHO OFF'
'UNPACK2 'floppy'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 9', 'IBM OS/2 2.1 Diskette 9')
'@ECHO OFF'
'UNPACK2 'floppy'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'DEL UNPACK2.EXE 'log
'@ECHO ON'
savedir = Directory( savedir )
RETURN /* end of OS21DK13 */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 17 diskette media. */
/*--------------------------------------------------------------------*/
OS21DK17: PROCEDURE EXPOSE floppy destination osver log
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
osver = OS2210
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
rc = MOUNTDISK('DISK 0', 'IBM OS/2 2.1 Installation Diskette')
'@ECHO OFF'
'XCOPY 'floppy'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'floppy'\*.BIO 'osVerDir'\DISK1\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 1', 'IBM OS/2 2.1 Diskette 1')
'@ECHO OFF'
'XCOPY 'floppy'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 2', 'IBM OS/2 2.1 Diskette 2')
'@ECHO OFF'
'UNPACK 'floppy'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'floppy'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'floppy'\UHPFS.DLL 'bootstrp'\*.* 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 3', 'IBM OS/2 2.1 Diskette 3')
'@ECHO OFF'
'UNPACK 'floppy'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 4', 'IBM OS/2 2.1 Diskette 4')
'@ECHO OFF'
'UNPACK 'floppy'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 5', 'IBM OS/2 2.1 Diskette 5')
'@ECHO OFF'
'UNPACK 'floppy'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
rc = MOUNTDISK('DISK 9', 'IBM OS/2 2.1 Diskette 9')
'@ECHO OFF'
'UNPACK 'floppy'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'@ECHO ON'
RETURN /* end of OS21DK17 */
/*-----------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 for Windows CD (11 disk image). */
/* */
/* The OS/2 2.1 for Windows CD-ROM does NOT contain a volume label. */
/*-----------------------------------------------------------------------*/
OS21CD11: PROCEDURE EXPOSE cdrom destination osver log cdsubdir cdromlabel
osver = OS2210
cdromlabel = ''
IF cdrom = 0 THEN
CALL GETCDROM
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
savedir = Directory()
destination = Directory( destination ) /* to copy unpack2.exe into */
SAY 'Creating directories'
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
SAY 'Loading files from DISK_1 image'
cddir = cdrom'\'cdsubdir'\DISK_1'
'@ECHO OFF'
'XCOPY 'cddir'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
/* Note: UNPACK2 from disk 2 required to handle DISK_0 bundle */
SAY 'Loading files from DISK_2 image'
cddir = cdrom'\'cdsubdir'\DISK_2'
'@ECHO OFF'
'XCOPY 'cddir'\UNPACK2.EXE *.* 'log
'UNPACK2 'cddir'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'cddir'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\UHPFS.DLL 'bootstrp'\*.* 'log
'UNPACK2 'cddir'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'@ECHO ON'
SAY 'Loading files from DISK_3 image'
cddir = cdrom'\'cdsubdir'\DISK_3'
'@ECHO OFF'
'UNPACK2 'cddir'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
SAY 'Loading files from DISK_9 image'
cddir = cdrom'\'cdsubdir'\DISK_9'
'@ECHO OFF'
'UNPACK2 'cddir'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'@ECHO ON'
SAY 'Loading files from DISK_0 image'
cddir = cdrom'\'cdsubdir'\DISK_0'
'@ECHO OFF'
'XCOPY 'cddir'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'cddir'\*.BIO 'osVerDir'\DISK1\*.* 'log
'UNPACK2 'cddir'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'DEL UNPACK2.EXE 'log
'@ECHO ON'
savedir = Directory( savedir )
cdromlabel = 'CDROMLABEL'
RETURN /* end of OS21CD11 */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 CD (13 diskette image). */
/*--------------------------------------------------------------------*/
OS21CD13: PROCEDURE EXPOSE cdrom destination osver log cdsubdir cdromlabel
osver = OS2210
IF cdrom = 0 THEN
CALL GETCDROM
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
savedir = Directory()
destination = Directory( destination ) /* to copy unpack2.exe into */
SAY 'Creating directories'
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
SAY 'Loading files from DISK_0 image'
cddir = cdrom'\'cdsubdir'\DISK_0'
'@ECHO OFF'
'XCOPY 'cddir'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'cddir'\*.BIO 'osVerDir'\DISK1\*.* 'log
'@ECHO ON'
SAY 'Loading files from DISK_1 image'
cddir = cdrom'\'cdsubdir'\DISK_1'
'@ECHO OFF'
'XCOPY 'cddir'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
SAY 'Loading files from DISK_2 image'
cddir = cdrom'\'cdsubdir'\DISK_2'
'@ECHO OFF'
'XCOPY 'cddir'\UNPACK2.EXE *.* 'log
'UNPACK2 'cddir'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'cddir'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\UHPFS.DLL 'bootstrp'\*.* 'log
'UNPACK2 'cddir'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'UNPACK2 'cddir'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'@ECHO ON'
SAY 'Loading files from DISK_3 image'
cddir = cdrom'\'cdsubdir'\DISK_3'
'@ECHO OFF'
'UNPACK2 'cddir'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
SAY 'Loading files from DISK_9 image'
cddir = cdrom'\'cdsubdir'\DISK_9'
'@ECHO OFF'
'UNPACK2 'cddir'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'DEL UNPACK2.EXE 'log
'@ECHO ON'
savedir = Directory( savedir )
RETURN /* end of OS21CD13 */
/*--------------------------------------------------------------------*/
/* Load special files from the OS/2 2.1 CD (17 diskette image). */
/*--------------------------------------------------------------------*/
OS21CD17: PROCEDURE EXPOSE cdrom destination osver log cdsubdir cdromlabel
osver = OS2210
IF cdrom = 0 THEN
CALL GETCDROM
osVerDir = destination || '\DISKIMAG' || '\'osver
bootstrp = destination || '\BOOTST21'
minios2 = destination || '\MINIOS2'
log = '>>'destination'\install.log'
savedir = Directory()
destination = Directory( destination )
SAY 'Creating directories'
rc = PATHMK( minios2 )
rc = PATHMK( bootstrp )
rc = PATHMK( destination || '\BOOTSTRP' )
rc = PATHMK( osVerDir || '\DISK1' )
rc = PATHMK( osVerDir || '\DLL' )
rc = PATHMK( osVerDir || '\SYSTEM' )
SAY 'Loading files from DISK_0 image'
cddir = cdrom'\'cdsubdir'\DISK_0'
'@ECHO OFF'
'XCOPY 'cddir'\SYSINSTX.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\ABIOS.SYS 'osVerDir'\DISK1\*.* 'log
'XCOPY 'cddir'\*.BIO 'osVerDir'\DISK1\*.* 'log
'@ECHO ON'
SAY 'Loading files from DISK_1 image'
cddir = cdrom'\'cdsubdir'\DISK_1'
'@ECHO OFF'
'XCOPY 'cddir'\*.* 'osVerDir'\DISK1\ 'log
'XCOPY 'osVerDir'\DISK1\CMD.EXE 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\DOS.SYS 'bootstrp'\*.* 'log
'XCOPY 'osVerDir'\DISK1\FDISK.COM 'bootstrp'\*.* 'log
'@ECHO ON'
SAY 'Loading files from DISK_2 image'
cddir = cdrom'\'cdsubdir'\DISK_2'
'@ECHO OFF'
'UNPACK 'cddir'\VGA 'osVerDir'\DLL /N:BVHVGA.DLL 'log
'XCOPY 'cddir'\FORMAT.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\CHKDSK.COM 'bootstrp'\*.* 'log
'XCOPY 'cddir'\UHPFS.DLL 'bootstrp'\*.* 'log
'@ECHO ON'
SAY 'Loading files from DISK_3 image'
cddir = cdrom'\'cdsubdir'\DISK_3'
'@ECHO OFF'
'UNPACK 'cddir'\BUNDLE 'bootstrp' /N:SETBOOT.EXE 'log
'@ECHO ON'
SAY 'Loading files from DISK_4 image'
cddir = cdrom'\'cdsubdir'\DISK_4'
'@ECHO OFF'
'UNPACK 'cddir'\BUNDLE 'osVerDir'\DISK1 /N:VDISK.SYS 'log
'@ECHO ON'
SAY 'Loading files from DISK_5 image'
cddir = cdrom'\'cdsubdir'\DISK_5'
'@ECHO OFF'
'UNPACK 'cddir'\BUNDLE 'osVerDir'\SYSTEM /N:OSO001.MSG 'log
'@ECHO ON'
SAY 'Loading files from DISK_9 image'
cddir = cdrom'\'cdsubdir'\DISK_9'
'@ECHO OFF'
'UNPACK 'cddir'\REQUIRED 'bootstrp' /N:MAKEINI.EXE 'log
'@ECHO ON'
savedir = Directory( savedir )
RETURN /* end of OS21CD17 */
/*--------------------------------------------------------------------*/
/* Load NetWare requester files. */
/*--------------------------------------------------------------------*/
LOADNETWARE: PROCEDURE EXPOSE destination log
getNetwareLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ The NetWare requester will be taken from the PC this command ║'
SAY '║ is being run on. ║'
SAY '║ ║'
SAY '║ Enter the path name where the requester can be found. ║'
SAY '║ ║'
SAY '║ For example: ║'
SAY '║ C:\NETWARE ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter PATH and press enter:'
PULL dataline
PARSE UPPER VAR dataline parm1 .
'@ECHO GetNetWareDir: NetWare path = 'dataline log
IF Length(parm1) <> 3 | Substr(parm1, 2, 1) <> ':' THEN
parm1 = Strip( parm1, 'T', '\' )
savedir = Directory()
netdir = Directory( parm1 )
IF netdir <> parm1 THEN DO
SAY
SAY 'Directory 'parm1' does not exist.'
'@ECHO Directory 'parm1' does not exist.' log
CALL PAUSEMSG
SIGNAL getNetwareLoop
END
IF Stream('LSL.SYS', 'c', 'query exists') == '' THEN DO
SAY
SAY 'Directory 'parm1' does not seem to contain the NetWare Requester.'
'@ECHO GetNetWareDir: LSL.SYS not found in 'parm1 log
CALL PAUSEMSG
SIGNAL getNetwareLoop
END
scriptdir = Directory( destination'\SCRIPT' )
shippeddir = '?:\NETWARE' /* what is in the file as shipped */
rcChng = CHNGFILE('NETODI.SCR', shippeddir, netdir)
'@ECHO ChangeNETODI.SCR: rc = 'rcChng log
savedir = Directory( savedir )
IF rcChng = 2 THEN DO
SAY
SAY 'Successful'
SAY
SAY 'Script 'scriptdir'\NETODI.SCR already references path 'netdir
CALL PAUSEMSG
RETURN
END
IF rcChng <> 0 THEN DO
SAY
SAY 'Error updating script 'scriptdir'\NETODI.SCR with path 'netdir
SAY 'You will have to perform the change manually.'
CALL PAUSEMSG
RETURN
END
SAY
SAY 'Successful'
SAY
SAY 'Script 'scriptdir'\NETODI.SCR has been updated to refer to 'netdir
CALL PAUSEMSG
RETURN /* end of LOADNETWARE */
/*--------------------------------------------------------------------*/
/* Load LAN Server 2.0 requester files. */
/*--------------------------------------------------------------------*/
LOADLS2: PROCEDURE EXPOSE floppy destination osver log
savedir = Directory()
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
rc = GETOSVER()
IF rc <> 0 THEN RETURN
osVerDir = destination || '\DISKIMAG' || '\'osver
macs = osVerDir || '\MACS'
com = osVerDir || '\IBMCOM'
log = '>>'destination'\install.log'
rc = PATHMK( macs )
rc = PATHMK( com )
dir = Directory( osVerDir )
filespec = SysSearchPath( 'PATH', 'PKUNZIP2.EXE' )
IF filespec == '' THEN DO
rc = MOUNTDISK('IBMA1V20R1', 'IBM OS/2 LAN Server V2.0 Requester Install Diskette 1')
'@ECHO OFF'
'XCOPY 'floppy'\PKUNZIP2.EXE *.* 'log
'@ECHO ON'
flag = 1
END
rc = MOUNTDISK('IBMA1V20N1', 'IBM OS/2 LAN Server V2.0 Network Adapter Drivers')
'@ECHO OFF'
'XCOPY 'floppy'\IBMCOM\NETBEUI.NIF 'macs log
'XCOPY 'floppy'\COMMON\*.OS2 'macs log
'XCOPY 'floppy'\COMMON\*.NIF 'macs log
'XCOPY 'floppy'\COMMON\ATCHAN\*.* 'macs log
'XCOPY 'floppy'\COMMON\MICRCHAN\*.OS2 'macs log
'XCOPY 'floppy'\COMMON\MICRCHAN\*.NIF 'macs log
'XCOPY 'floppy'\COMMON\MICRCHAN\*.BIN 'macs log
'XCOPY 'floppy'\COMMON\LT2.MSG 'com log
'@ECHO ON'
rc = MOUNTDISK('IBMA1V20R2', 'IBM OS/2 LAN Server V2.0 Requester Install Diskette 2')
'@ECHO OFF'
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\LANMSGDD.OS2 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\DLL\LANMSGDL.DLL 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\LANMSGEX.EXE 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\LT0.MSG 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\PRO.MSG 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\PROTMAN.OS2 'log
'PKUNZIP2 -o 'floppy'\LXPTBASE.ZIP 'com' IBMCOM\PROTOCOL\NETBIND.EXE 'log
'PKUNZIP2 -o 'floppy'\LXPTJETB.ZIP 'com' IBMCOM\DLL\ACSNETB.DLL 'log
'PKUNZIP2 -o 'floppy'\LXPTJETB.ZIP 'com' IBMCOM\PROTOCOL\NETBEUI.OS2 'log
'PKUNZIP2 -o 'floppy'\LXPTJETB.ZIP 'com' IBMCOM\PROTOCOL\NETBIOS.OS2 'log
'PKUNZIP2 -o 'floppy'\LXPT8022.ZIP 'com' IBMCOM\DLL\ACSLAN.DLL 'log
'@ECHO ON'
IF flag = 1 THEN
'DEL PKUNZIP2.EXE 'log
dir = Directory( savedir )
RETURN /* end of LOADLS2 */
/*--------------------------------------------------------------------*/
/* Load LAN Server 3.0 requester files. */
/*--------------------------------------------------------------------*/
LOADLS3: PROCEDURE EXPOSE floppy destination osver log
savedir = Directory()
IF floppy = 0 THEN DO
rc = GETFLOPPY()
IF rc <> 0 THEN RETURN
END
rc = GETOSVER()
IF rc <> 0 THEN RETURN
osVerDir = destination || '\DISKIMAG' || '\'osver
macs = osVerDir || '\MACS'
com = osVerDir || '\IBMCOM'
diribmcom = floppy'\IBMCOM'
dirmacs = floppy'\IBMCOM\MACS'
dirdll = floppy'\IBMCOM\DLL'
dirprot = floppy'\IBMCOM\PROTOCOL'
log = '>>'destination'\install.log'
rc = PATHMK( macs )
rc = PATHMK( com )
mountLoop:
rc = MOUNTDISK('', 'IBM NTS/2 Lan Adapter and Protocol Support 1.0 diskette')
d1 = Directory( dirmacs )
d2 = Directory( dirdll )
d3 = Directory( dirprot )
IF (d1 == dirmacs) & ,
(d2 == dirdll) & ,
(d3 == dirprot) THEN NOP
ELSE DO
SAY
SAY 'Error: Incorrect diskette. Required directories'
SAY ' not present.'
CALL PAUSEMSG
SIGNAL mountLoop
END
dir = Directory( osVerDir )
filespec = SysSearchPath( 'PATH', 'PKUNZIP2.EXE' )
IF filespec == '' THEN DO
'@ECHO OFF'
'XCOPY 'floppy'\PKUNZIP2.EXE *.* 'log
'@ECHO ON'
flag = 1
END
'@ECHO OFF'
'PKUNZIP2 -o 'dirmacs'\MACS.ZIP .\MACS *.* 'log
'XCOPY 'floppy'\IBMCOM\LT0.MSG .\IBMCOM\*.* 'log
'PKUNZIP2 -o 'diribmcom'\IBMCOM.ZIP .\IBMCOM LANMSGDD.OS2 'log
'PKUNZIP2 -o 'diribmcom'\IBMCOM.ZIP .\IBMCOM LANMSGEX.EXE 'log
'PKUNZIP2 -o 'diribmcom'\IBMCOM.ZIP .\IBMCOM LT2.MSG 'log
'PKUNZIP2 -o 'diribmcom'\IBMCOM.ZIP .\IBMCOM PRO.MSG 'log
'PKUNZIP2 -o 'diribmcom'\IBMCOM.ZIP .\IBMCOM PROTMAN.OS2 'log
'PKUNZIP2 -o 'dirdll'\DLL.ZIP .\IBMCOM ACSLAN.DLL 'log
'PKUNZIP2 -o 'dirdll'\DLL.ZIP .\IBMCOM ACSNETB.DLL 'log
'XCOPY 'floppy'\IBMCOM\DLL\LANMSGDL.DLL .\IBMCOM\*.* 'log
'PKUNZIP2 -o 'dirprot'\PROTOCOL.ZIP .\IBMCOM NETBEUI.OS2 'log
'PKUNZIP2 -o 'dirprot'\PROTOCOL.ZIP .\IBMCOM NETBIND.EXE 'log
'PKUNZIP2 -o 'dirprot'\PROTOCOL.ZIP .\IBMCOM NETBIOS.OS2 'log
IF flag = 1 THEN
'DEL PKUNZIP2.EXE 'log
'@ECHO ON'
dir = Directory( savedir )
RETURN /* end of LOADLS3 */
/*--------------------------------------------------------------------*/
/* Create Mini-OS/2 package. */
/*--------------------------------------------------------------------*/
CREATEMINI: PROCEDURE EXPOSE destination env log
savedir = Directory()
/*-------------------------------------------------------------------*/
/* Determine the boot drive. Since there is not built in way to */
/* retrieve the boot drive from REXX use the drive in the COMSPEC */
/* environment variable. */
/*-------------------------------------------------------------------*/
comspecenv = Value( 'COMSPEC',, env )
PARSE UPPER VAR comspecenv comspecenv
'@ECHO COMSPEC environment variable "'comspecenv'"' log
IF comspecenv = '' THEN DO
SAY
SAY 'Error: No COMSPEC= environment variable defined.'
CALL PAUSEMSG
RETURN 1
END
bootdrive = FileSpec( 'Drive', comspecenv )
bootdrive = Strip( bootdrive )
'@ECHO Boot drive "'bootdrive'"' log
/*-------------------------------------------------------------------*/
/* Determine the drive that contains \IBMCOM. */
/*-------------------------------------------------------------------*/
dpathenv = Value( 'DPATH',, env )
PARSE UPPER VAR ibmcomdrive ibmcomdrive
'@ECHO DPATH environment variable "'dpathenv'"' log
IF dpathenv = '' THEN DO
SAY
SAY 'Error: No DPATH= environment variable defined.'
CALL PAUSEMSG
RETURN 1
END
PARSE VAR dpathenv ibmcomdrive ':\IBMCOM' .
IF ibmcomdrive == dpathenv THEN ibmcomdrive = bootdrive
ELSE DO
ibmcomdrive = Right( ibmcomdrive, 1 ) || ':'
END
'@ECHO ibmcomdrive = "'ibmcomdrive'"' log
/*-------------------------------------------------------------------*/
/* Now ask the user if they want to override any of the drive */
/* values. */
/*-------------------------------------------------------------------*/
done = 'FALSE'
DO WHILE done == 'FALSE'
SAY ' OS2 input drive = 'bootdrive
SAY 'IBMCOM input drive = 'ibmcomdrive
'@ECHO User confirmation: boot="'bootdrive'" ' ,
'ibmcom="'ibmcomdrive'"' log
SAY
SAY 'Proceed with the above drives? Enter Y to continue or any other'
SAY 'key to use different drive(s):'
PULL ans
IF ans == 'Y' THEN DO
done = 'TRUE'
'@ECHO User confirms use of above drives.' log
END
ELSE DO
'@ECHO User wants to override the above drives.' log
SAY
SAY 'Enter drive for OS/2 system files or press ENTER to accept'
SAY '"'bootdrive'".'
PARSE UPPER PULL userinput .
'@ECHO For bootdrive user specified "'userinput'"' log
SELECT
WHEN Length( userinput ) == 0 THEN NOP
WHEN Length( userinput ) == 1 THEN bootdrive = userinput || ':'
WHEN Length( userinput ) == 2 THEN DO
IF Substr( userinput, 2, 1 ) == ':' THEN bootdrive = userinput
ELSE SAY 'Error: Invalid drive letter is ignored.'
END
OTHERWISE SAY 'Error: Invalid drive letter is ignored.'
END
SAY
SAY 'Enter drive for IBMCOM files or press ENTER to accept'
SAY '"'ibmcomdrive'".'
PARSE UPPER PULL userinput .
'@ECHO For \IBMCOM user specified "'userinput'"' log
SELECT
WHEN Length( userinput ) == 0 THEN NOP
WHEN Length( userinput ) == 1 THEN ibmcomdrive = userinput || ':'
WHEN Length( userinput ) == 2 THEN DO
IF Substr( userinput, 2, 1 ) == ':' THEN ibmcomdrive = userinput
ELSE SAY 'Error: Invalid drive letter is ignored.'
END
OTHERWISE SAY 'Error: Invalid drive letter is ignored.'
END
END
END
rc = PATHMK( destination'\MINIOS2\OS2\DLL' )
rc = PATHMK( destination'\MINIOS2\OS2\SYSTEM' )
rc = PATHMK( destination'\MINIOS2\IBMCOM\DLL' )
rc = PATHMK( destination'\MINIOS2\IBMCOM\MACS' )
rc = PATHMK( destination'\MINIOS2\IBMCOM\PROTOCOL' )
/*-------------------------------------------------------------------*/
/* Copy the OS/2 kernal files. */
/*-------------------------------------------------------------------*/
SAY
SAY 'Copying OS/2 kernel...'
srcdir = bootdrive'\'
tgtdir = destination'\MINIOS2\'
'@ECHO OFF'
'XCOPY 'srcdir'OS2LDR 'tgtdir'*.* /r /h /t /o ' log
'XCOPY 'srcdir'OS2LDR.MSG 'tgtdir'*.* /r /h /t /o ' log
'XCOPY 'srcdir'OS2KRNL 'tgtdir'*.* /r /h /t /o ' log
rc = SysFileTree( srcdir'OS2VER', stem, 'FO' )
IF stem.0 > 0 THEN DO
'XCOPY 'srcdir'OS2VER 'tgtdir'*.* /r /h /t /o ' log
END
'ATTRIB -r -h -s 'tgtdir'*.* ' log
'@ECHO ON'
/*-------------------------------------------------------------------*/
/* Copy the required OS/2 base files. */
/*-------------------------------------------------------------------*/
SAY
SAY 'Copying OS/2 base system...'
srcdir = bootdrive'\OS2\'
tgtdir = destination'\MINIOS2\OS2\'
'@ECHO OFF'
'XCOPY 'srcdir'CLOCK*.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'KBD*.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'PRINT*.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'SCREEN*.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'*.ADD 'tgtdir'*.* ' log
rc = SysFileTree( srcdir'*.I13', stem, 'FO' )
IF stem.0 > 0 THEN DO
'XCOPY 'srcdir'*.I13 'tgtdir'*.* ' log
END
'XCOPY 'srcdir'CMD.EXE 'tgtdir'*.* ' log
'XCOPY 'srcdir'HPFS.IFS 'tgtdir'*.* ' log
'XCOPY 'srcdir'KEYBOARD.DCP 'tgtdir'*.* ' log
'XCOPY 'srcdir'OS2DASD.DMD 'tgtdir'*.* ' log
'XCOPY 'srcdir'OS2SCSI.DMD 'tgtdir'*.* ' log
'XCOPY 'srcdir'TESTCFG.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'VIOTBL.DCP 'tgtdir'*.* ' log
'XCOPY 'srcdir'VDISK.SYS 'tgtdir'*.* ' log
'@ECHO ON'
/*-------------------------------------------------------------------*/
/* Copy the required OS/2 DLL files. */
/*-------------------------------------------------------------------*/
srcdir = bootdrive'\OS2\DLL\'
tgtdir = destination'\MINIOS2\OS2\DLL\'
'@ECHO OFF'
'XCOPY 'srcdir'ANSICALL.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'BDCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'BKSCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'BMSCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'BVHINIT.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'bvhvga.dll 'tgtdir'*.* ' log
'XCOPY 'srcdir'BVSCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'DOSCALL1.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'KBDCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'MOUCALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'MSG.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'NAMPIPES.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'NLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'NPXEMLTR.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'OS2CHAR.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'QUECALLS.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'SESMGR.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'VIOCALLS.DLL 'tgtdir'*.* ' log
'@ECHO ON'
/*-------------------------------------------------------------------*/
/* Copy the required OS/2 SYSTEM files. */
/*-------------------------------------------------------------------*/
srcdir = bootdrive'\OS2\SYSTEM\'
tgtdir = destination'\MINIOS2\OS2\SYSTEM\'
'@ECHO OFF'
'XCOPY 'srcdir'COUNTRY.SYS 'tgtdir'*.* ' log
'XCOPY 'srcdir'OSO001.MSG 'tgtdir'*.* ' log
'@ECHO ON'
/*-------------------------------------------------------------------*/
/* Copy the NETBIOS files. The assumptions are: */
/* */
/* - The current system has an IBMCOM directory. */
/* - The IBMCOM directory is correctly setup. That is, */
/* NETBIOS currently works. */
/*-------------------------------------------------------------------*/
SAY
SAY 'Copying IBMCOM files for NETBIOS...'
srcdir = ibmcomdrive'\IBMCOM\'
tgtdir = destination'\MINIOS2\IBMCOM\'
'@ECHO OFF'
'XCOPY 'srcdir'LANMSGDD.OS2 'tgtdir'*.* ' log
'XCOPY 'srcdir'LANMSGEX.EXE 'tgtdir'*.* ' log
'XCOPY 'srcdir'LT0.MSG 'tgtdir'*.* ' log
'XCOPY 'srcdir'LT2.MSG 'tgtdir'*.* ' log
'XCOPY 'srcdir'PRO.MSG 'tgtdir'*.* ' log
'XCOPY 'srcdir'PROTMAN.OS2 'tgtdir'*.* ' log
'XCOPY 'srcdir'PROTOCOL.INI 'tgtdir'*.* ' log
srcdir = ibmcomdrive'\IBMCOM\MACS\'
tgtdir = destination'\MINIOS2\IBMCOM\MACS\'
'XCOPY 'srcdir'*.* 'tgtdir'*.* ' log
srcdir = ibmcomdrive'\IBMCOM\DLL\'
tgtdir = destination'\MINIOS2\IBMCOM\DLL\'
'XCOPY 'srcdir'ACSLAN.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'ACSNETB.DLL 'tgtdir'*.* ' log
'XCOPY 'srcdir'LANMSGDL.DLL 'tgtdir'*.* ' log
srcdir = ibmcomdrive'\IBMCOM\PROTOCOL\'
tgtdir = destination'\MINIOS2\IBMCOM\PROTOCOL\'
'XCOPY 'srcdir'NETBEUI.OS2 'tgtdir'*.* ' log
'XCOPY 'srcdir'NETBIND.EXE 'tgtdir'*.* ' log
'XCOPY 'srcdir'NETBIOS.OS2 'tgtdir'*.* ' log
'@ECHO ON'
dir = Directory( savedir )
RETURN /* end of CREATEMINI */
/*--------------------------------------------------------------------*/
/* Ask user to select A: or B: to read diskettes from. */
/*--------------------------------------------------------------------*/
GETFLOPPY: PROCEDURE EXPOSE floppy log
getFloppyLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT Drive from which to read diskettes ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ A │ A: ║'
SAY '║ │ ║'
SAY '║ B │ B: ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL driveLetter
'@ECHO GetFloppyDrive: 'driveLetter' selected' log
SAY
SELECT
WHEN driveLetter = 'A' THEN
floppy = 'A:'
WHEN driveLetter = 'A:' THEN
floppy = 'A:'
WHEN driveLetter = 'B' THEN
floppy = 'B:'
WHEN driveLetter = 'B:' THEN
floppy = 'B:'
WHEN driveLetter = 'X' THEN
RETURN 1
OTHERWISE
DO
SAY 'Invalid drive selected.'
CALL PAUSEMSG
SIGNAL getFloppyLoop
END
END /* of SELECT */
RETURN 0 /* end of GETFLOPPY */
/*--------------------------------------------------------------------*/
/* Set up for trial authorization. */
/*--------------------------------------------------------------------*/
AUTHTRIAL: PROCEDURE EXPOSE destination log trialDays trialAccess ,
trialCsName defTrialDays
expiryChange:
CALL SysCls
pos = SysCurPos( 0, 0 )
PARSE VALUE Date('U') WITH month '/' day '/' year
day = day + trialDays
DO WHILE day > 28 /* note: approximation */
day = day - 28
month = month + 1
END
DO WHILE month > 12
month = month - 12
year = year + 1
END
IF Length(month) = 1 THEN
month = '0'||month
IF Length(day) = 1 THEN
day = '0'||day
trialAccess = trialAccess - 1 + 1 /* remove leading zero's */
IF Length(trialAccess) = 1 THEN
trialAccess = '0'||trialAccess
expiry = month||'/'||day||'/'||year
trialCsName = Substr(trialCsName, 1, 8) /* truncate or blank pad */
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ The trial authorization key will be based on the following ║'
SAY '║ parameters: ║'
SAY '║ ║'
SAY '║ Code Server name ............... 'trialCsName' ║'
SAY '║ Trial expiry date............... 'expiry' ║'
SAY '║ Number of concurrent accesses... 'trialAccess' ║'
SAY '║ Company or Organization name.... ???????? ║'
SAY '║ ║'
SAY '║ Please enter your company or organization name. ║'
SAY '║ ║'
SAY '║ For example: ║'
SAY '║ ABC Enterprises Inc. ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter your company or organization name (truncated at 50 chars)'
SAY ' or C to change the expiry date'
SAY ' or X to return to the main menu:'
PARSE PULL coName
IF Translate(coName) = 'X' THEN
RETURN 0
IF Translate(coName) = 'C' THEN DO /* option to change expiry days */
trialDaysAgain:
SAY
SAY 'Enter number of trial days (default = 'defTrialDays')'
PULL trialDays
IF Datatype(trialDays) <> 'NUM' THEN DO
SAY '"'trialDays'" is invalid, must be numeric'
SIGNAL trialDaysAgain
END
IF trialDays > 90 THEN DO
SAY 'Number of days to large, must be 90 or less'
SIGNAL trialDaysAgain
END
SIGNAL expiryChange
END
coName = Substr(coName, 1, 50) /* truncate or blank pad */
reCalcChksum:
bits = Bitxor(trialCsName, expiry)
bits = Bitxor(bits, trialAccess)
bits = Bitxor(bits, coName)
chksum = '0000'x
i = Length(bits) /* code below assumes i > 2 */
IF i//2 = 0 THEN
i = i - 1 /* pos of even byte pair is odd */
DO WHILE i > 0
chksum = Bitxor(chksum, Substr(bits, i, 2, '00'x))
i = i - 2
END
chksum = C2X(chksum)
promptAuthCodeTrial:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ Please call/fax/e-mail ForeFront Software to obtain an ║'
SAY '║ authorization key for your trial. ║'
SAY '║ ║'
SAY '║ You must supply the following information exactly as ║'
SAY '║ shown below to obtain the key: ║'
SAY '║ ║'
SAY '║ Code Server name ............... 'trialCsName' ║'
SAY '║ Trial expiry date............... 'expiry' ║'
SAY '║ Number of concurrent accesses... 'trialAccess' ║'
SAY '║ ║'
SAY '║ Company or Organization name: ║'
SAY '║ ║'
SAY '║ 'coName' ║'
SAY '║ ║'
SAY '║ Checksum........................ 'chksum' ║'
SAY '║ ║'
SAY '║ You will be given an authorization key which you should enter ║'
SAY '║ below. You may enter X below to return to the main ACTIONS ║'
SAY '║ menu and perform the authorization later if you wish. ║'
SAY '║ ║'
SAY '║ ForeFront can be reached at: ║'
SAY '║ ║'
SAY '║ phone: (403) 531-2160 ║'
SAY '║ fax: (403) 270-0372 ║'
SAY '║ CIM: 73110,722 ║'
SAY '║ ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter authorization key or X to return to the main menu:'
PULL authCode
IF authCode = 'X' THEN
RETURN 0
IF authCode = 'C' THEN DO /* option to change expiry days */
trialDaysAgain2:
SAY
SAY 'Enter number of days for trial'
PULL newTrialDays
IF Datatype(newtrialDays) <> 'NUM' THEN
SIGNAL trialDaysAgain2
IF newTrialDays > 125 THEN
SIGNAL trialDaysAgain2
PARSE VALUE Date('U') WITH month '/' day '/' year
day = day + newTrialDays
DO WHILE day > 28
day = day - 28
month = month + 1
END
DO WHILE month > 12
month = month - 12
year = year + 1
END
IF Length(month) = 1 THEN
month = '0'||month
IF Length(day) = 1 THEN
day = '0'||day
expiry = month||'/'||day||'/'||year
SIGNAL reCalcChksum
END
IF Length(Strip(authCode)) <> 12 THEN DO
SAY
SAY 'Invalid authorization code.'
CALL PAUSEMSG
SIGNAL promptAuthCodeTrial
END
'@ECHO authTrial: code server name = 'trialCsName log
'@ECHO expiry = 'expiry log
'@ECHO accesses = 'trialAccess log
'@ECHO company = 'coName log
'@ECHO check sum = 'chksum log
'@ECHO auth code = 'authCode log
retcode = CHECKSUMAUTHCODE()
IF retcode <> 0 THEN DO
SAY
SAY 'The authorization code you entered has a checksum error.'
CALL PAUSEMSG
SIGNAL promptAuthCodeTrial
END
savedir = Directory()
authdir = destination ||'\BIN\SERVER'
rc = PATHMK( authdir )
authdir = Directory( authdir )
filename = Strip(trialCsName) || '.AUT'
bakname = Strip(trialCsName) || '.BAK'
rc = SysFileTree( filename, stem, 'FO' )
IF stem.0 > 0 THEN DO
'@ECHO Backing up previous 'filename' to 'bakname log
'@ECHO OFF'
'XCOPY 'filename' *.BAK' log
'DEL 'filename log
'@ECHO ON'
END
Call Lineout filename, 'TRIAL', 1
Call Lineout filename, trialCsName
Call Lineout filename, expiry
Call Lineout filename, trialAccess
Call Lineout filename, coName
Call Lineout filename, chksum
Call Lineout filename, authCode
Call Stream filename, 'C', 'CLOSE'
'@ECHO 'filename' successfully written to 'authdir log
RETURN 0 /* end of AUTHTRIAL */
/*--------------------------------------------------------------------*/
/* Set up authorization for production LCF use. */
/*--------------------------------------------------------------------*/
AUTHPROD: PROCEDURE EXPOSE destination log
CALL SysCls
pos = SysCurPos( 0, 0 )
prodCsName = '????????'
prodAccess = '??'
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ The production authorization key will be based on the ║'
SAY '║ following parameters: ║'
SAY '║ ║'
SAY '║ Company or Organization name.... ???????? ║'
SAY '║ Code Server name ............... 'prodCsName' ║'
SAY '║ Number of concurrent accesses... 'prodAccess' ║'
SAY '║ ║'
SAY '║ Please enter your company or organization name. ║'
SAY '║ ║'
SAY '║ For example: ║'
SAY '║ ABC Enterprises Inc. ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter your company or organization name (truncated at 50 chars):'
PARSE PULL coName
coName = Substr(coName, 1, 50) /* truncate or blank pad */
SAY
SAY 'Enter the Code Server Name you intend to use (eg. OS2BENCH):'
prodCsNameLoop:
PARSE UPPER LINEIN prodCsName rest
IF Datatype(prodCsName, 'A') <> 1 THEN DO
SAY
SAY'Code Server name entered is invalid, reenter it:'
SIGNAL prodCsNameLoop
END
prodCsName = Substr(prodCSName, 1, 8) /* truncate or blank pad */
SAY
SAY 'Enter the number of concurrent accesses this code server will have:'
prodAccessLoop:
PULL prodAccess
IF Datatype(prodAccess) <> 'NUM' | prodAccess < 1 | prodAccess > 32 THEN DO
SAY
SAY'Number of concurrent accesses is invalid, reenter it (1-32 valid):'
SIGNAL prodAccessLoop
END
prodAccess = prodAccess - 1 + 1 /* remove leading zero's */
IF Length(prodAccess) = 1 THEN
prodAccess = '0'||prodAccess
bits = Bitxor(prodCsName, prodAccess)
bits = Bitxor(bits, coName)
chksum = '0000'x
i = Length(bits) /* code below assumes i > 2 */
IF i//2 = 0 THEN
i = i - 1 /* pos of even byte pair is odd */
DO WHILE i > 0
chksum = Bitxor(chksum, Substr(bits, i, 2, '00'x))
i = i - 2
END
chksum = C2X(chksum)
promptAuthCodeProd:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ Please call/fax/e-mail ForeFront Software to obtain an ║'
SAY '║ authorization key for this production LCF server. ║'
SAY '║ ║'
SAY '║ You must supply the following information exactly as ║'
SAY '║ shown below to obtain the key: ║'
SAY '║ ║'
SAY '║ Code Server name ............... 'prodCsName' ║'
SAY '║ Number of concurrent accesses... 'prodAccess' ║'
SAY '║ ║'
SAY '║ Company or Organization name: ║'
SAY '║ ║'
SAY '║ 'coName' ║'
SAY '║ ║'
SAY '║ Checksum........................ 'chksum' ║'
SAY '║ ║'
SAY '║ You will be given an authorization key which you should enter ║'
SAY '║ below. You may enter X below to return to the main ACTIONS ║'
SAY '║ menu and perform the authorization later if you wish. ║'
SAY '║ ║'
SAY '║ ForeFront can be reached at: ║'
SAY '║ ║'
SAY '║ phone: (403) 531-2160 ║'
SAY '║ fax: (403) 270-0372 ║'
SAY '║ CIM: 73110,722 ║'
SAY '║ ║'
SAY '║ ║'
SAY '╚════════════════════════════════════════════════════════════════╝'
SAY 'Enter authorization key or X to return to the main menu:'
PULL authCode
IF authCode = 'X' THEN
RETURN 0
IF Length(Strip(authCode)) <> 12 THEN DO
SAY
SAY 'Invalid authorization code.'
CALL PAUSEMSG
SIGNAL promptAuthCodeProd
END
'@ECHO authProd: code server name = 'prodCsName log
'@ECHO accesses = 'prodAccess log
'@ECHO company = 'coName log
'@ECHO check sum = 'chksum log
'@ECHO auth code = 'authCode log
retcode = CHECKSUMAUTHCODE()
IF retcode <> 0 THEN DO
SAY
SAY 'The authorization code you entered has a checksum error.'
CALL PAUSEMSG
SIGNAL promptAuthCodeProd
END
savedir = Directory()
authdir = destination ||'\BIN\SERVER'
rc = PATHMK( authdir )
authdir = Directory( authdir )
filename = Strip(prodCsName) || '.AUT'
bakname = Strip(prodCsName) || '.BAK'
rc = SysFileTree( filename, stem, 'FO' )
IF stem.0 > 0 THEN DO
'@ECHO Backing up previous 'filename' to 'bakname log
'@ECHO OFF'
'XCOPY 'filename' *.BAK' log
'DEL 'filename log
'@ECHO ON'
END
Call Lineout filename, 'PROD', 1
Call Lineout filename, prodCsName
Call Lineout filename, prodAccess
Call Lineout filename, coName
Call Lineout filename, chksum
Call Lineout filename, authCode
Call Stream filename, 'C', 'CLOSE'
'@ECHO 'filename' successfully written to 'authdir log
RETURN 0 /* end of AUTHPROD */
/*--------------------------------------------------------------------*/
/* Make sure the AuthCode has a valid checksum byte */
/*--------------------------------------------------------------------*/
CHECKSUMAUTHCODE: PROCEDURE EXPOSE authCode
IF Datatype(authCode, X) <> 1 THEN
RETURN 1
IF Pos(' ', authCode) <> 0 THEN
RETURN 1
code = X2c(authCode)
chk = '00'x
i = Length(code) - 1
DO WHILE i > 0
chk = Bitxor(chk, Substr(code, i, 1, '00'x))
i = i - 1
END
IF chk == Substr(code, Length(code), 1) THEN
RETURN 0
RETURN 1
/*--------------------------------------------------------------------*/
/* Ask user to identify CDROM drive and check the media in it. */
/*--------------------------------------------------------------------*/
GETCDROM: PROCEDURE EXPOSE cdrom cdromlabel log
getCdromLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY
SAY 'Enter drive letter of CD-ROM:'
PULL cdrom
'@ECHO GetCDROMDrive: 'cdrom' entered' log
SELECT
WHEN Length( cdrom ) == 1 THEN cdrom = cdrom':'
WHEN Length( cdrom ) == 2 THEN DO
IF Substr( cdrom, 2, 1 ) <> ':' THEN DO
SAY
SAY 'Error: Invalid drive id.'
CALL PAUSEMSG
SIGNAL getCdromLoop
END
END
OTHERWISE DO
SAY
SAY 'Error: Invalid drive id.'
CALL PAUSEMSG
SIGNAL getCdromLoop
END
END /* of SELECT */
SAY
SAY 'Insert IBM OS/2 CD-ROM in 'cdrom' and press any key when read...'
key = SysGetKey( 'NOECHO' )
done = 'FALSE'
DO WHILE done == 'FALSE'
driveinfo = SysDriveInfo( cdrom )
PARSE VAR driveinfo . . . vollabel
IF driveinfo == '' THEN DO
'@ECHO ReadCDROM: Drive not ready' log
SAY
SAY 'Error: Drive 'cdrom' is NOT READY.'
CALL PAUSEMSG
END
ELSE DO
vollabel = STRIP( vollabel )
IF cdromlabel == '' THEN done = TRUE
ELSE IF vollabel == cdromlabel THEN done = TRUE
ELSE DO
'@ECHO ReadCDROM: Label = 'vollabel' is incorrect' log
SAY
SAY 'Error: Incorrect CD-ROM. Label = "'vollabel'"'.
SAY ' Insert IBM OS/2 CD-ROM in 'cdrom
CALL PAUSEMSG
END
END
END /* end of DO WHILE */
RETURN /* end of GETCDROM */
/*--------------------------------------------------------------------*/
/* Ask user to select OS2 2.0 or 2.1 for loading LAN requester */
/*--------------------------------------------------------------------*/
GETOSVER: PROCEDURE EXPOSE osver log
getOsverLoop:
CALL SysCls
pos = SysCurPos( 0, 0 )
SAY '╔════════════════════════════════════════════════════════════════╗'
SAY '║ ║'
SAY '║ SELECT OS/2 LAN requester is for ║'
SAY '║ ║'
SAY '║ Note: If you require the requester for use with more than ║'
SAY '║ one release of OS/2 then you will need to run this procedure ║'
SAY '║ once for each release. ║'
SAY '║ ║'
SAY '╟──────────────┬─────────────────────────────────────────────────╢'
SAY '║ SELECTION │ Description ║'
SAY '╟──────────────┼─────────────────────────────────────────────────╢'
SAY '║ │ ║'
SAY '║ 0 │ OS/2 2.0 ║'
SAY '║ │ ║'
SAY '║ 1 │ OS/2 2.1 ║'
SAY '║ │ ║'
SAY '║ X │ Return to main actions menu. ║'
SAY '║ │ ║'
SAY '╚══════════════╧═════════════════════════════════════════════════╝'
SAY 'Enter SELECTION and press enter:'
PULL osverResponse
'@ECHO GetOSVer: Option 'osverResponse' selected' log
SAY
SELECT
WHEN osverResponse = 0 THEN
osver = 'OS2200'
WHEN osverResponse = 1 THEN
osver = 'OS2210'
WHEN osverResponse = 'X' THEN
RETURN 1
OTHERWISE
DO
SAY 'Invalid selection.'
CALL PAUSEMSG
SIGNAL getOsverLoop
END
END /* of SELECT */
RETURN 0 /* end of GETOSVER */
/*--------------------------------------------------------------------*/
/* Build all required directories for a directory path. */
/* */
/* eg. PATHMK c:\a\b\c will build any dirs in the path. */
/* PATHMK t\m\o will build t in the current dir. */
/*--------------------------------------------------------------------*/
PATHMK: PROCEDURE EXPOSE log /* This function is RECURSIVE */
/* This function may change the current directory */
ARG dir
retcode = 0
'@ECHO PATHMK entered for : 'dir log
newdir = Directory( dir )
IF (newdir <> dir) THEN DO
i = Lastpos('\', dir)
IF i <= 1 THEN DO
IF Pos(':', dir) <> 0 THEN DO
newdir = Directory( dir'\' )
RETURN retcode
END
retcode = SysMkDir( dir )
'@ECHO PATHMK 'dir' retcode = 'retcode log
newdir = Directory( dir )
RETURN retcode;
END
parent = SUBSTR(dir, 1, i-1);
curr = SUBSTR(dir, i+1, ,' ');
retcode = PATHMK(parent) /* recurse */
IF retcode = 0 THEN DO
retcode = SysMkDir( curr )
'@ECHO PATHMK 'curr' retcode = 'retcode log
newdir = Directory( curr )
END
END
RETURN retcode /* end of PATHMK */
/*--------------------------------------------------------------------*/
/* Ask user to insert a diskette into the floppy drive */
/*--------------------------------------------------------------------*/
MOUNTDISK: PROCEDURE EXPOSE floppy log
PARSE ARG label, description
'@ECHO MOUNTDISK entered for : 'label' 'description log
Call SysCls
pos = SysCurPos( 0, 0 )
done = 'FALSE'
DO WHILE done == 'FALSE'
SAY
SAY 'Insert 'description' into 'floppy
SAY
SAY 'Press any key when ready...'
key = SysGetKey( 'NOECHO' )
driveinfo = SysDriveInfo( floppy )
SAY
SAY 'Reading 'floppy
SAY
PARSE VAR driveinfo . . . vollabel
IF driveinfo == '' THEN DO
'@ECHO MOUNTDISK: Drive 'floppy' not ready' log
SAY
SAY 'Error: Drive 'floppy' is NOT READY.'
CALL PAUSEMSG
END
ELSE DO
vollabel = STRIP( vollabel )
IF vollabel == label THEN done = TRUE
ELSE DO
'@ECHO MOUNTDISK: Wrong label 'vollabel log
SAY
SAY 'Error: Incorrect diskette. Label = "'vollabel'"'.
CALL PAUSEMSG
END
END
END
RETURN 0 /* end of MOUNTDISK */
/*--------------------------------------------------------------------*/
/* Change one or more string within a file. */
/*--------------------------------------------------------------------*/
CHNGFILE: PROCEDURE EXPOSE log
Arg file, fromString, toString
'@ECHO CHNGFILE: File = 'file' from = 'fromString' to = 'toString log
fileTemp = 'CHNGFILE.TMP'
fileBackup = 'CHNGFILE.SAV'
flag = 0
flag2 = 0
DO WHILE Lines(file) > 0
line = Linein(file)
j = Pos(fromString,line)
IF j <> 0 THEN DO
line = substr(line, 1, j-1) || toString || ,
substr(line,j+length(fromString))
flag = 1
END
IF Pos(toString,line) <> 0 THEN flag2 = 1
Call Lineout fileTemp, line
END
Call Stream file, 'C', 'CLOSE'
IF flag = 1 THEN DO
Call Stream fileTemp, 'C', 'CLOSE'
'@ECHO OFF'
'COPY 'file' 'fileBackup' >>NUL'
'DEL 'file
'REN 'fileTemp ' 'file
'DEL 'fileBackup
'@ECHO ON'
'@ECHO CHNGFILE: successful' log
RETURN 0
END
IF flag2 = 1 THEN DO
'@ECHO CHNGFILE: retcode = 2' log
RETURN 2
END
'@ECHO CHNGFILE: retcode = 1' log
RETURN 1