home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 35 Internet
/
35-Internet.zip
/
wcnewice.zip
/
install.cmd
next >
Wrap
OS/2 REXX Batch file
|
1998-01-27
|
4KB
|
132 lines
/**/
call RxFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
call SysLoadFuncs
arg whatodo
if whatodo == '/R' | whatodo == '-R' then signal removeit
signal on halt name cleanup
say 'This script creates program objects for MR/2 ICE and the MR/2 ICE'
say 'WarpCenter Notifier, and puts a shadow of the Notifier in your OS/2'
say 'startup folder.'
say ''
say 'Stand by... locating MR/2 ICE program and data directories...'
icedir = finddirof('MR2ITF.ORG')
if icedir = '' then do
say "I can't find your MR/2 ICE data directory. Sorry."
exit 1
end
say 'Found MR/2 ICE data directory:' icedir
if stream(icedir'MR2I.EXE', 'C', 'QUERY EXISTS') \== '' then
icebin = icedir
else do
icebin = SysSearchPath('PATH', 'MR2I.EXE')
if icebin == '' then do
icebin = finddirof('MR2I.EXE')
if icebin = '' then do
say "I can't find your MR/2 ICE program directory. Sorry."
exit 1
end
end
end
say 'Found MR/2 ICE program directory:' icebin
say ''
say 'Installing MR/2 ICE WarpCenter Notifier...'
'@copy WCNewICE.EXE' icebin'WCNewICE.EXE >nul 2>&1'
if rc \= 0 then do
say 'Copy of MR/2 ICE WarpCenter Notifier failed!'
exit 1
end
say 'Creating MR/2 ICE program object for WarpCenter...'
rv = SysCreateObject('WPProgram', 'MR/2 Internet Cruiser', '<WP_DESKTOP>',,
'OBJECTID=<CCINBOX>;EXENAME='icebin'MR2I.EXE', 'R')
if rv = 0 then do
say 'Creation of WarpCenter-enabled MR/2 ICE program object failed!'
exit 1
end
say 'Creating MR/2 ICE WarpCenter Notifier program object...'
rv = SysCreateObject('WPProgram', 'MR/2 ICE WarpCenter Notifier',,
'<WP_DESKTOP>', 'OBJECTID=<MR/2_ICE_WCN>;' ||,
'EXENAME='icebin'WCNewICE.EXE;PMTYPE=PM;' ||,
'STARTUPDIR='icedir, 'R')
if rv = 0 then do
say 'Creation of MR/2 ICE WarpCenter Notifier program object failed!'
exit 1
end
say 'Creating shadow of MR/2 ICE Warpcenter Notifier in Startup folder...'
rv = SysCreateObject('WPShadow', ' ', '<WP_START>',,
'OBJECTID=<MR/2_ICE_WCN_Shadow>;SHADOWID=<MR/2_ICE_WCN>',,
'R')
if rv = 0 then do
say 'Creation of MR/2 ICE WarpCenter notifier shadow failed!'
exit 1
end
say ''
say 'The MR/2 ICE WarpCenter Notifier is now installed. You will need to'
say 'reboot to activate it, because WarpCenter only checks for the mailer'
say 'object at startup (simply closing and reopening it doesn''t count).'
say ''
say 'The WarpCenter "new mail" indicator is immediately to the left of the'
say 'Information Center icon on the right side of the WarpCenter. It is'
say 'normally empty; when WarpCenter detects new mail, the indicator shows'
say 'an envelope icon. Click on it to open or display MR/2 ICE.'
exit 0
finddirof: procedure; arg name
/* first, check for a common naming convention */
map = SysDriveMap()
do i = 1 to words(map)
dv = word(map, i)
if stream(dv'\MR2I\'name, 'C', 'QUERY EXISTS') \== '' then return dv'\MR2I\'
end
/* now start searching all drive toplevels */
here = directory()
len = length(name)
do i = 1 to words(map)
dv = word(map, i)
call directory dv'\'
call SysFileTree name, 'x.', 'FO'
if x.0 = 1 then do
call directory here
return left(x.1, length(x.1) - len)
end
end
/* ...then get *really* nasty */
do i = 1 to words(map)
dv = word(map, i)
call directory dv'\'
call SysFileTree name, 'x.', 'FOS'
if x.0 = 1 then do
call directory here
return left(x.1, length(x.1) - len)
end
end
drop here
return ''
removeit:
say 'Finding the MR/2 ICE program directory...'
icebin = SysSearchPath('PATH', 'MR2I.EXE')
if icebin == '' then do
icebin = finddirof('MR2I.EXE')
if icebin = '' then do
say "I can't find your MR/2 ICE program directory. Sorry."
exit 1
end
end
say 'Found MR/2 ICE program directory:' icebin
say ''
say 'Removing the MR/2 ICE WarpCenter Notifier...'
say 'If this script hangs, close the WarpCenter.'
call SysDestroyObject '<MR/2_ICE_WCN_Shadow>'
call SysDestroyObject '<MR/2_ICE_WCN>'
call SysFileDelete icebin'WCNewICE.EXE'
call SysDestroyObject '<CCINBOX>'
exit 0
cleanup:
say 'Interrupted. Cleaning up...'
if symbol('here') == 'VAR' then call directory here
exit 99