home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
netdor3.zip
/
DISK_13
/
IMAGE12.ZIP
/
CATALOG
/
OPENDOOR.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-09-20
|
6KB
|
160 lines
/*****************************************************************************
* COREADD backend for OpenDoor *
* CORE Development (CORE at WATSON) *
*****************************************************************************
* Licensed Materials-Property of IBM *
* 5604-472 (c) Copyright IBM Corporation, 1993 *
* All rights reserved. *
* US Government Users Restricted Rights - *
* Use, duplication or disclosure restricted *
* by GSA ADP Schedule Contract with IBM Corp. *
****************************************************************************/
trace 'O'
signal on syntax
signal on novalue
call on halt
call rxfuncadd 'CADDINIT', 'RXCADD', 'CADDINIT'
Ver = 'CAddInit'()
if abbrev(Ver, 'ERROR:')
then exit 200
Title = RxCAdd.STitle 'Installation'
XCode = 0
FilesSource. = 0
FilesDest. = 0
FilesSource.0 = '[REMOTE]\OPENDOOR\OPENDOOR.EXE'; FilesDest.0 = '[SYSTEM]\OPENDOOR.EXE'
FilesSource.1 = '[REMOTE]\OPENDOOR\OPENDOOR.HLP'; FilesDest.1 = '[SYSTEM]\OPENDOOR.HLP'
FilesSource.2 = '[REMOTE]\DLL\COUENV.DLL'; FilesDest.2 = '[DLL]\COUENV.DLL'
FilesSource.3 = '[REMOTE]\DLL\NICK16.DLL'; FilesDest.3 = '[DLL]\NICK16.DLL'
select
when RxCAdd.OpType = 'ADD'
then do
call rxfuncadd 'RXCOUINFO', 'COUENV', 'RXCOUINFO'
call rxfuncadd 'RXCOUCOPY', 'COUCOPY', 'RXCOUCOPY'
signal on syntax name NoCouEnv
call rxCouInfo 'VER'
signal on syntax name syntax
BaseExeDir = rxCouInfo('GET', 'SYSTEM')
ExeDir = strip(BaseExeDir, 'T', '\')'\'
rc = 0
do i = 0 by 1 while (FilesSource.i <> 0 & rc = 0)
say 'Copying 'FilesSource.i' to 'FilesDest.i'...'
rc = RxCouCopy(FilesSource.i, FilesDest.i, 'DEFER', RxCAdd.STitle, 'AUTOUPDATE')
end
if rc = 0 then do
inifile = RxCouInfo('GET', 'INIFILE')
value = RxOS2Ini(inifile, 'COREUP', 'Access')
value = strip(value, 'T', '0'x)
select
when value = 'NETBIOS' then do
say 'Copying [REMOTE]\OPENDOOR\COUILR.DLL to [DLL]\COUILR.DLL...'
rc = RxCouCopy('[REMOTE]\OPENDOOR\COUILR.DLL', '[DLL]\COUILR.DLL', 'DEFER',,
RxCAdd.STitle, 'AUTOUPDATE')
end
when value = 'NFS' then do
say 'Copying [REMOTE]\OPENDOOR\COUNFS.DLL to [DLL]\COUNFS.DLL...'
rc = RxCouCopy('[REMOTE]\OPENDOOR\COUNFS.DLL', '[DLL]\COUNFS.DLL', 'DEFER',,
RxCAdd.STitle, 'AUTOUPDATE')
end
otherwise
rc = 50
end
end
if rc = 0 then do
RxCadd.ProgInfo.4 = 'EXE='ExeDir'OPENDOOR.EXE'
RxCadd.ProgInfo.6 = 'WORKDIR='BaseExeDir
end; else do
say 'Error 'rc' occured attempting to copy files to your machine.'
XCode = rc
end
end
when RxCAdd.OpType = 'REMOVE'
then do
call rxfuncadd 'RXCOUDELETEALL', 'COUCOPY', 'RXCOUDELETEALL'
say 'Removing 'RxCAdd.STitle'...'
rc = RxCouDeleteAll(RxCAdd.STitle, 'IMMEDIATE')
if rc <> 0 then do
say 'Error 'rc' occured trying to remove 'RxCAdd.STitle' from your machine.'
XCode = 1
end
end
otherwise do
call 'MessageBox' Title, 'Unexpected operation type "'RxCAdd.OpType'"'
XCode = 201
end
end
call AddExit XCode
NoCouEnv:
call AddExit 10, 'COUENV.DLL could not be found.'
AddExit:
parse arg XCode, Msg
if XCode = ''
then XCode = 0
if Msg <> ''
then call 'MessageBox' Title, Msg
call 'CAddComplete' XCode
call rxSleep 2
if RxCAdd.OpType = 'ADD' then do
parse var RxCAdd.ProgInfo.1 '=' LTitle
if rxOs2Ver() >= 2.0
then do
if \SysCreateObject('WPShadow', LTitle, '<WP_START>',,
'OBJECTID=<COU_SHAD_COREINIT>;SHADOWID=<CORE_APP_'RxCAdd.STitle'>;', 'U')
then call 'MessageBox' Title, 'Warning: Shadow could not be created in',
'System Startup folder.'
end
else do
call rxOs2Ini 'USER', 'PM_Autostart', 'NetDoor\'LTitle, '1'||'0'x
end
end
call 'CAddExit'
exit XCode
/***********************************************************************
* 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 = 'COREADD Failure'
Me = Me':'||'0A'x
if symbol('GLOBALS') = 'LIT'
then do
Globals = 'TrVal'
TrVal = 'O'
end
return
Halt:
Where = SigL
call BugInit
call 'MessageBox' Title, Me||'Execution halted by user in line' Where
XXC = 204
signal DebugExit
Syntax:
Where = SigL
call BugInit
call 'MessageBox' Title,,
Me||'Syntax error' rc '('errortext(rc)') in line' Where'.'
XXC = 203
signal DebugExit
Novalue:
Where = SigL
call BugInit
call 'MessageBox' Title, Me||'NOVALUE error ('condition('D')') in line' Where'.'
XXC = 203
signal DebugExit
DebugExit:
call 'CAddComplete' XXC
call 'CAddExit'
exit XXC