home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Science
/
Science.zip
/
elem-os2.zip
/
install.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-01-23
|
8KB
|
267 lines
/* Rexx by: David DuPre */
/* INSTALL.CMD */
/* Recreate the Weather Robo Icon if it is accidentally deleted */
/* Upgraded to 1.9d INSTALL with file checking */
/* Upgraded to 1.9e Fixed file checking for bug in REXX call */
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
'@echo off&cls'
say '0d0a'x
say "Do not run this INSTALL.CMD by clicking on the ICON! "
say "Be sure you opened an OS/2 session, switched to"
say "the subdirectory and ran the INSTALL.CMD."
say '0d0a'x
'@pause'
inidir=directory()
if pos('.',inidir)>0 then do
say '0d0a'x
Say '---- Problem with the subdirectory name you choose.-----'
say inidir||' contains a "." period in it. This will cause Element.ary! to '
say 'malfunction. Please rename the subdirectory or reinstall '
say 'in a subdirectory that does not contain a "." period in it.'
say 'Rerun INSTALL.CMD after you change the directory name.'
say '0d0a'x
exit
end
Files="elemntry.exe element.dat elemmpeg.exe gbmsize.exe INSTALL.CMD"
files=files||' gbm.dll mpegio.dll rxgdutil.dll unzipapi.dll vprptdll.dll vrobj.dll'
files=files||' PMWEATHR.VPT PMWEATH2.VPT'
files=files||' element.txt legal.txt mpeg_Lic.txt order.txt readme.1st RXGDUTIL.TXT'
delFiles="cities.dat mpeg.dat radar.dat images.dat subscrip.dat"
do until delfiles=''
parse var delfiles first delfiles
first=strip(first)
check=stream(first,'c','query exist')
if check = inidir'\'first then '@del 'first
else do
nop
end
end
dirtyflag=''
do until files=''
parse var files first files
first=translate(strip(first))
check=stream(first,'c','query exist')
if check<>'' then check=translate(check)
compare=translate(inidir'\'first)
if debug='on' then say 'Check='check
if debug='on' then say 'ini...='compare
if check = compare then say 'Checking==> 'first' OK, Exists'
else do
say 'Checking==> 'first' Missing, please copy it to 'inidir
dirtyflag=dirtyflag|| first ||' '
end
end
if length(dirtyflag)>2 then do
say '-------'||"Problem! Cannot install. Please resolve problems above."
exit
end
else
say '-------All files accounted for. Installation continues.--------'
'e legal.txt'
say '0d0a'x
say "If you disagree with anything in the license agreement"
say "press <CTRL>+C to end this installation now, or if you agree"
say '0d0a'x
'pause'
parse source one two w3
current=directory() /* Thanks to:Duane A. Chamblee 1/17/96 */
tgtdrv = substr(w3,1,2)
option = "update"
address CMD
'@echo off'
call setlocal
target_dir = ''
szVideoMode = ''
parse arg target_dir szVideoMode
folder_title = 'Element.ary! for OS/2'
if( target_dir = '' )then
target_dir = directory()
else do
if( lastpos( "\", target_dir ) = length( target_dir ) ) then do
target_dir = left( target_dir, length( target_dir ) - 1 )
end
end
target_dir = directory( target_dir )
bldDemo = 0
/* Create main folder object */
say 'Building Workplace Shell Element.ary! for OS/2 Objects...'
classname = 'WPFolder'
title = folder_title
location = '<WP_DESKTOP>'
iconparm = 'ICONFILE=' || target_dir || '\Elemntry.ICO;'
setup = 'OBJECTID=<ELEMENT_ARY_FOLDER>;' || iconparm
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPFolder'
title = 'Documentation'
location = '<ELEMENT_ARY_FOLDER>'
iconparm = 'ICONFILE=' || target_dir || '\Elemntry.ICO;'
setup = 'OBJECTID=<ELEMENT_ARY_DOC>;' || iconparm
call SysCreateObject classname, title, location, setup, 'r'
/* Create the Readme program object */
/* Create a Color Palette */
classname = 'WPColorPalette'
title = 'Color Palette'
location = '<ELEMENT_ARY_FOLDER>'
setup =''
call SysCreateObject classname, title, location, setup, 'r'
/* Create a Font Palette */
classname = 'WPFontPalette'
title = 'Font Palette'
location = '<ELEMENT_ARY_FOLDER>'
setup =''
call SysCreateObject classname, title, location, setup, 'r'
/* Create the Element-ary program object */
classname = 'WPProgram'
title = 'Element.ary! for OS/2'
location = '<ELEMENT_ARY_FOLDER>'
setup = 'EXENAME=' || target_dir || '\elemntry.exe;' ||,
'PROGTYPE=PM;STARTUPDIR='current';'
call SysCreateObject classname, title, location, setup, 'r'
/* Create the PURCHASE program object */
classname = 'WPProgram'
title = 'Purchase Element.ary!'
location = '<ELEMENT_ARY_FOLDER>'
setup = 'EXENAME=' || target_dir || '\purchase.exe;' ||,
'PROGTYPE=PM;STARTUPDIR='current';'
call SysCreateObject classname, title, location, setup, 'r'
/* Create Shadows. */
classname = 'WPShadow'
title = 'Element-ary files'
location = '<ELEMENT_ARY_FOLDER>'
setup = 'SHADOWID='|| current||';OBJECTID=<ELEMENT_ARY_FILES>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'Element-ary - Description and release notes.'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\Element.txt;OBJECTID=<ELEMENT_ARY_TXT>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'Element-ary Order Form'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\Order.txt;OBJECTID=<ELEMENT_ARY_ORDER>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'Element-ary Legal Issues'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\legal.txt;OBJECTID=<ELEMENT_ARY_LEGAL>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'Element-ary MPEG License'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\mpeg_lic.txt;OBJECTID=<ELEMENT_ARY_MPEG_LIC>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'RXGDUTIL License'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\RXGDUTIL.txt;OBJECTID=<RXGDUTIL_LIC>'
call SysCreateObject classname, title, location, setup, 'r'
classname = 'WPShadow'
title = 'Element-ary Documentation'
location = '<ELEMENT_ARY_DOC>'
setup = 'SHADOWID='|| current||'\README.1ST;OBJECTID=<ELEMENT_ARY_DOCUMENTATION>'
call SysCreateObject classname, title, location, setup, 'r'
Drivelist=SysDriveMap('C:', 'LOCAL')
say 'Found ['drivelist'] LOCAL Drives'
do until Drivelist=''
parse var drivelist drv drivelist
drv=strip(drv)
Say 'Attempting to get lastest RXSOCK.DLL from '||drv||'\TCPIP\DLL'
'replace '||drv||'\tcpip\dll\rxsock.dll /u '
end
Say 'Installing extra Utilities included with Element.ary! for OS/2'
'unzip -o htm2txt1'
f_name = '<ELEMENT_ARY_FOLDER>'
p_name = '<HTM2TXT>'
call SysCreateObject 'WPProgram','HTML to Text',f_name,'OBJECTID='p_name, 'r'
call SysSetObjectData p_name,'EXENAME=htm2txt.cmd'
call SysSetObjectData p_name,'PROGTYPE=PM'
call SysSetObjectData p_name,'ICONFILE='directory()'\htm2txt.ico'
'call makeobj.cmd'
say 'Setup is complete'
exit
/*
* FileExists
*/
FileExists:
return( stream( arg(1), 'c', 'query exists' ) <> '' )
/* add the Weather Robo ICON */
Classname= 'WPProgram'
Title = 'WEATHER from the Internet'
Location = '<WP_DESKTOP>'
Setup = 'EXENAME='current'\elemntry.exe;OBJECTID=<PMWTHR>;STARTUPDIR='current';ICONFILE='current'\PMWEATHR.ICO'
result=SysCreateObject(classname,Title,Location,Setup,option)
/* Turned off for now. 11-96
Classname= 'WPProgram'
Title = 'Weather Robot'
Location = '<WP_DESKTOP>'
Setup = 'EXENAME='current'\Wthrrobo.EXE;OBJECTID=<WthrRobo>;STARTUPDIR='current';ICONFILE='current'\WthrRobo.ICO'
result=SysCreateObject(classname,Title,Location,Setup,option)
*/
RETURN 0