home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
netdor3.zip
/
DISK_13
/
IMAGE12.ZIP
/
CATALOG
/
DOORAUTO.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-08-23
|
4KB
|
133 lines
/*****************************************************************************
* IBM NetDoor Catalog - Recreate NetDoor Startup folder *
* 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
if 'REGFUNC'('COUENV') <> 0
then call AddExit 206, 'Error registering COUENV.DLL.'
ObjId = '<CORE_STARTUP_FOLDER>'
CDr = strip(rxCouInfo('GET', 'REMOTE'), 'T', '\')'\'
if rxCouInfo('VER') = 1
then Icon = CDr'CATALOG\COUAUTO.ICO'
else Icon = CDr'COREADD\COUAUTO.ICO'
select
when RxCAdd.OpType = 'ADD'
then do
if rxOs2Ver() < 2.0
then call AddExit 2, 'The CORE Startup Folder is only supported on',
'OS/2 2.0 and later.'
if \SysCreateObject('WPFolder', 'CORE Startup', '<CORE_COREFOLDER>',,
'OBJECTID='ObjId';ICONFILE='Icon, 'U')
then if \SysCreateObject('WPFolder', 'CORE Startup', '<WP_DESKTOP>',,
'OBJECTID='ObjId';ICONFILE='Icon, 'U')
then call AddExit 3, Title 'could not be created.'
else call 'MessageBox' Title, 'The startup folder was created',
'on the desktop as the product folder could not be',
'located.'
end
when RxCAdd.OpType = 'REMOVE'
then do
call 'MessageBox' 'If you really want to destroy the CORE Startup',
'folder and all of it''s contents, shred it.'
XCode = 2
end
otherwise do
call 'MessageBox' Title, 'Unexpected operation type "'RxCAdd.OpType'"'
XCode = 201
end
end
call AddExit XCode
RunItl: procedure expose RXCADD. Title
parse arg ItlName
CDr = rxCouInfo('GET', 'REMOTE')
List = 'VERSION STITLE OPTYPE PREVIOUS'
do I = 1 to words(List)
Name = 'RXCADD.'word(List, I)
call value Name, value(Name), 'OS2ENVIRONMENT'
end I
do I = 1 to RXCADD.PROGINFO.0
call value 'RXCADD.PROGINFO.'I, RXCADD.PROGINFO.I, 'OS2ENVIRONMENT'
end I
if pos('\', ItlName) = 0
then do
parse source . . Me
ItlName = left(Me, lastpos('\', Me))||ItlName
end
'@CALL' CDr'IMPIT.CMD /R:'ItlName '/NOPAUSE'
if rc <> 0
then call AddExit 205, 'Error' rc 'returned by ITL interpreter.'
return rc
AddExit:
parse arg XCode, Msg
if XCode = ''
then XCode = 0
if Msg <> ''
then call 'MessageBox' Title, Msg
call 'CAddComplete' XCode
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 = 'Catalog 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