home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
netdorup.zip
/
ip20073.zip
/
NDCSD1.DSK
/
unc.dsk
/
CFSYSL.CMD
next >
Wrap
OS/2 REXX Batch file
|
1994-02-10
|
5KB
|
144 lines
/***************************************************************************
* Fix for NetDoor clients *
***************************************************************************
* Copyright (c) IBM Corporation, 1994. Permission granted to distribute, *
* modify, or copy this program, but not to resell. *
***************************************************************************
* Return Codes: *
* ───────────── *
* 100: Could not load RXUTILS.DLL. *
* 101: Could not load COUENV.DLL. *
* 102: Could not load COUCOPY.DLL. *
* *
* 2xx: Error xx from RxCouAssociateAppFile for SYSLEVEL.COU. *
* 3xx: Error xx from RxCouInfo. *
* 4xx: Error xx from RxCouAssociateAppFile for MAINT.HLP *
***************************************************************************/
parse arg Opts
signal on syntax
signal on novalue
call on halt
'@ECHO OFF'
TrVal = value('CORETRACE',,'OS2ENVIRONMENT')
if TrVal = '' then TrVal = 'N'
trace value TrVal
if 'REGFUNC'('RXUTILS') <> 0
then exit 100
if wordpos('DEBUG', translate(Opts)) <> 0
then do
call setlocal
BDr = RxBootDrive()
OutFile = BDr'\MAINTFIX.LOG'
say '╔═════════════════════════════════════════════════════════════════════════════╗'
say '║ Running Fix in DEBUG mode. ║'
say '║ The Log File Name is: ║'
say '║'center(OutFile, 77)'║'
say '╚═════════════════════════════════════════════════════════════════════════════╝'
call rxPause
call value 'CORETRACE','I','OS2ENVIRONMENT'
parse source . . Me
interpret "'CALL" Me "2>"OutFile"'"
call endlocal
exit rc
end
if 'REGFUNC'('COUENV') <> 0
then exit 101
if 'REGFUNC'('COUCOPY') <> 0
then exit 102
/*****************************************************************************
* Fix code begins here *
*****************************************************************************/
/* 1. Register SYSLEVEL.COU file with COUCOPY. */
RemoteFile = '[remote]\SYSLEVEL.COU' /* Location of file on image */
LocalFile = '[system]\SYSLEVEL.COU' /* Location of file locally */
/* Remove installation supplied dummy association (which was pointing
to the wrong place anyways). */
call rxCouRemoveAppFile 'COU', '[local]\SYSLEVEL.COU'
/* Set new, correct association for file, and ensure that it keeps the
read-only bit off on each update. Required, since the ServicePack
tool insists that syslevel files be R/O, and NetDoor 1.0 installation
doesn't expect that. */
Res = rxCouAssociateAppFile('COU', RemoteFile, LocalFIle, 'AUTOUPDATE', '-R')
if abbrev(Res, 'ERROR:')
then do
parse var Res ':' Res
exit 200 + Res
end
/* 2. Set up correct association for MAINT.HLP file. */
/* Identify the name of the remote directory. */
if rxCouInfo('VER') = 1
then HelpDir = 'HELP'
else HelpDir = 'BOOK'
/* Check whether the COUENV we are using supports HELP. */
Res = rxCouInfo('GET', 'HELP')
if Res = 'ERROR:6' /* unknown key */
then LocalHelp = '[local]\HELP'
else if abbrev(Res, 'ERROR:')
then do
parse var Res ':' Res
exit 300 + Res
end
else LocalHelp = '[help]'
/* Set up the association */
Res = rxCouAssociateAppFile('MAINT', '[remote]\'HelpDir'\MAINT.HLP',,
LocalHelp'\MAINT.HLP', 'AUTOUPDATE')
if abbrev(Res, 'ERROR:')
then do
parse var Res ':' Res
exit 400 + Res
end
exit 0
/***********************************************************************
* ERROR TRAPS *
***********************************************************************/
BugInit:
signal off error; signal off failure; signal off halt
signal off novalue; signal off notready; signal off syntax
parse upper source . . Me
if symbol('TITLE') = 'LIT'
then Title = 'Catalog Failure'
Me = Me':'||'0A'x
if symbol('GLOBALS') = 'LIT'
then do
Globals = 'TrVal'
TrVal = 'O'
end
return
Halt:
Where = SigL
call BugInit
say 'Execution halted by user in line' Where
XXC = 204
signal DebugExit
Syntax:
Where = SigL
call BugInit
say Me||'Syntax error' rc '('errortext(rc)') in line' Where'.'
XXC = 203
signal DebugExit
Novalue:
Where = SigL
call BugInit
say 'NOVALUE error ('condition('D')') in line' Where'.'
XXC = 203
signal DebugExit
DebugExit:
exit XXC