home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Science / Science.zip / elem-os2.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1997-01-23  |  8KB  |  267 lines

  1. /* Rexx by: David DuPre */
  2. /* INSTALL.CMD */
  3. /* Recreate the Weather Robo Icon if it is accidentally deleted */
  4. /* Upgraded to 1.9d INSTALL with file checking */
  5. /* Upgraded to 1.9e Fixed file checking for bug in REXX call */
  6.  
  7. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  8. call SysLoadFuncs
  9.  
  10. '@echo off&cls'
  11. say '0d0a'x
  12. say "Do not run this INSTALL.CMD by clicking on the ICON!  "
  13. say "Be sure you opened an OS/2 session, switched to"
  14. say "the subdirectory and ran the INSTALL.CMD."
  15. say '0d0a'x
  16. '@pause'
  17.  
  18. inidir=directory()
  19.  
  20. if pos('.',inidir)>0 then do
  21.   say '0d0a'x
  22.   Say '---- Problem with the subdirectory name you choose.-----'
  23.   say inidir||' contains a "." period in it.  This will cause Element.ary! to '
  24.   say 'malfunction.  Please rename the subdirectory or reinstall '
  25.   say 'in a subdirectory that does not contain a "." period in it.'
  26.   say 'Rerun INSTALL.CMD after you change the directory name.'
  27.   say '0d0a'x
  28.   exit
  29. end
  30.  
  31. Files="elemntry.exe element.dat elemmpeg.exe gbmsize.exe INSTALL.CMD"
  32. files=files||' gbm.dll mpegio.dll rxgdutil.dll unzipapi.dll vprptdll.dll vrobj.dll'
  33. files=files||' PMWEATHR.VPT PMWEATH2.VPT'
  34. files=files||' element.txt legal.txt mpeg_Lic.txt order.txt readme.1st RXGDUTIL.TXT'
  35.  
  36. delFiles="cities.dat mpeg.dat radar.dat images.dat subscrip.dat"
  37.  
  38. do until delfiles=''
  39.  parse var delfiles first delfiles
  40.  first=strip(first)
  41.  check=stream(first,'c','query exist')
  42.  if check = inidir'\'first then '@del 'first
  43.  else do
  44.     nop
  45.  end
  46. end
  47.  
  48. dirtyflag=''
  49.  
  50. do until files=''
  51.  parse var files first files
  52.  first=translate(strip(first))
  53.  check=stream(first,'c','query exist')
  54.  if check<>'' then check=translate(check)
  55.  compare=translate(inidir'\'first)
  56.  if debug='on' then  say 'Check='check
  57.  if debug='on' then  say 'ini...='compare
  58.  if check = compare then say 'Checking==> 'first' OK, Exists'
  59.  else do
  60.     say 'Checking==> 'first' Missing, please copy it to 'inidir
  61.     dirtyflag=dirtyflag|| first ||'  '
  62.  end
  63. end
  64.   if length(dirtyflag)>2 then do
  65.     say '-------'||"Problem! Cannot install. Please resolve problems above."
  66.     exit
  67.   end
  68.   else 
  69.     say '-------All files accounted for.  Installation continues.--------'
  70.  
  71. 'e legal.txt'
  72. say '0d0a'x
  73. say "If you disagree with anything in the license agreement"
  74. say "press <CTRL>+C to end this installation now, or if you agree"
  75. say '0d0a'x
  76. 'pause'
  77. parse source one two w3
  78. current=directory()      /* Thanks to:Duane A. Chamblee 1/17/96 */
  79. tgtdrv = substr(w3,1,2)
  80.  
  81. option = "update"
  82.  
  83.  
  84. address CMD
  85. '@echo off'
  86. call setlocal
  87. target_dir   = ''
  88. szVideoMode = ''
  89. parse arg target_dir szVideoMode
  90.  
  91. folder_title = 'Element.ary! for OS/2'
  92.  
  93. if( target_dir = '' )then
  94.     target_dir = directory()
  95. else do
  96.     if( lastpos( "\", target_dir ) = length( target_dir ) ) then do
  97.         target_dir = left( target_dir, length( target_dir ) - 1 )
  98.     end
  99. end
  100.  
  101. target_dir = directory( target_dir )
  102. bldDemo = 0
  103.  
  104. /* Create main folder object */
  105. say 'Building Workplace Shell Element.ary! for OS/2 Objects...'
  106. classname = 'WPFolder'
  107. title     = folder_title
  108. location  = '<WP_DESKTOP>'
  109. iconparm  = 'ICONFILE=' || target_dir || '\Elemntry.ICO;'
  110. setup     = 'OBJECTID=<ELEMENT_ARY_FOLDER>;' || iconparm
  111.  
  112. call SysCreateObject classname, title, location, setup, 'r'
  113.  
  114. classname = 'WPFolder'
  115. title     = 'Documentation'
  116. location  = '<ELEMENT_ARY_FOLDER>'
  117. iconparm  = 'ICONFILE=' || target_dir || '\Elemntry.ICO;'
  118. setup     = 'OBJECTID=<ELEMENT_ARY_DOC>;' || iconparm
  119.  
  120. call SysCreateObject classname, title, location, setup, 'r'
  121.  
  122. /* Create the Readme program object */
  123.  
  124. /* Create a Color Palette */
  125.  
  126. classname = 'WPColorPalette'
  127. title     = 'Color Palette'
  128. location  = '<ELEMENT_ARY_FOLDER>'
  129. setup =''
  130.  
  131. call SysCreateObject classname, title, location, setup, 'r'
  132.  
  133. /* Create a Font Palette */
  134.  
  135.  
  136. classname = 'WPFontPalette'
  137. title     = 'Font Palette'
  138. location  = '<ELEMENT_ARY_FOLDER>'
  139. setup =''
  140.  
  141. call SysCreateObject classname, title, location, setup, 'r'
  142.  
  143. /* Create the Element-ary program object */
  144.  
  145. classname = 'WPProgram'
  146. title     = 'Element.ary! for OS/2'
  147. location  = '<ELEMENT_ARY_FOLDER>'
  148. setup     = 'EXENAME=' || target_dir || '\elemntry.exe;' ||,
  149.         'PROGTYPE=PM;STARTUPDIR='current';'
  150.  
  151. call SysCreateObject classname, title, location, setup, 'r'
  152.  
  153. /* Create the PURCHASE program object */
  154.  
  155. classname = 'WPProgram'
  156. title     = 'Purchase Element.ary!'
  157. location  = '<ELEMENT_ARY_FOLDER>'
  158. setup     = 'EXENAME=' || target_dir || '\purchase.exe;' ||,
  159.         'PROGTYPE=PM;STARTUPDIR='current';'
  160.  
  161. call SysCreateObject classname, title, location, setup, 'r'
  162.  
  163. /* Create Shadows. */
  164.  
  165. classname = 'WPShadow'
  166. title     = 'Element-ary files'
  167. location  = '<ELEMENT_ARY_FOLDER>'
  168. setup     = 'SHADOWID='|| current||';OBJECTID=<ELEMENT_ARY_FILES>'
  169.  
  170. call SysCreateObject classname, title, location, setup, 'r'
  171.  
  172. classname = 'WPShadow'
  173. title     = 'Element-ary  - Description and release notes.'
  174. location  = '<ELEMENT_ARY_DOC>'
  175. setup     = 'SHADOWID='|| current||'\Element.txt;OBJECTID=<ELEMENT_ARY_TXT>'
  176.  
  177. call SysCreateObject classname, title, location, setup, 'r'
  178.  
  179. classname = 'WPShadow'
  180. title     = 'Element-ary Order Form'
  181. location  = '<ELEMENT_ARY_DOC>'
  182. setup     = 'SHADOWID='|| current||'\Order.txt;OBJECTID=<ELEMENT_ARY_ORDER>'
  183.  
  184. call SysCreateObject classname, title, location, setup, 'r'
  185.  
  186. classname = 'WPShadow'
  187. title     = 'Element-ary Legal Issues'
  188. location  = '<ELEMENT_ARY_DOC>'
  189. setup     = 'SHADOWID='|| current||'\legal.txt;OBJECTID=<ELEMENT_ARY_LEGAL>'
  190.  
  191. call SysCreateObject classname, title, location, setup, 'r'
  192.  
  193. classname = 'WPShadow'
  194. title     = 'Element-ary MPEG License'
  195. location  = '<ELEMENT_ARY_DOC>'
  196. setup     = 'SHADOWID='|| current||'\mpeg_lic.txt;OBJECTID=<ELEMENT_ARY_MPEG_LIC>'
  197.  
  198. call SysCreateObject classname, title, location, setup, 'r'
  199.  
  200. classname = 'WPShadow'
  201. title     = 'RXGDUTIL License'
  202. location  = '<ELEMENT_ARY_DOC>'
  203. setup     = 'SHADOWID='|| current||'\RXGDUTIL.txt;OBJECTID=<RXGDUTIL_LIC>'
  204.  
  205. call SysCreateObject classname, title, location, setup, 'r'
  206.  
  207. classname = 'WPShadow'
  208. title     = 'Element-ary Documentation'
  209. location  = '<ELEMENT_ARY_DOC>'
  210. setup     = 'SHADOWID='|| current||'\README.1ST;OBJECTID=<ELEMENT_ARY_DOCUMENTATION>'
  211.  
  212. call SysCreateObject classname, title, location, setup, 'r'
  213.  
  214. Drivelist=SysDriveMap('C:', 'LOCAL')
  215. say 'Found ['drivelist'] LOCAL Drives'
  216.  
  217. do until Drivelist=''
  218.   parse var drivelist drv drivelist
  219.   drv=strip(drv)
  220.   Say 'Attempting to get lastest RXSOCK.DLL from '||drv||'\TCPIP\DLL'
  221.   'replace '||drv||'\tcpip\dll\rxsock.dll /u '
  222. end
  223.  
  224. Say 'Installing extra Utilities included with Element.ary! for OS/2'
  225.  
  226. 'unzip -o htm2txt1'
  227.  
  228.    f_name = '<ELEMENT_ARY_FOLDER>'
  229.    p_name = '<HTM2TXT>'
  230.  
  231.    call SysCreateObject 'WPProgram','HTML to Text',f_name,'OBJECTID='p_name, 'r'
  232.    call SysSetObjectData p_name,'EXENAME=htm2txt.cmd'
  233.    call SysSetObjectData p_name,'PROGTYPE=PM'
  234.    call SysSetObjectData p_name,'ICONFILE='directory()'\htm2txt.ico'
  235.  
  236. 'call makeobj.cmd'
  237.  
  238. say 'Setup is complete'
  239.  
  240. exit
  241.  
  242. /*
  243.  * FileExists
  244.  */
  245.     
  246. FileExists:
  247.  
  248. return( stream( arg(1), 'c', 'query exists' ) <> '' )
  249.  
  250. /* add the Weather Robo ICON */
  251. Classname= 'WPProgram'
  252. Title =   'WEATHER from the Internet'
  253. Location =  '<WP_DESKTOP>'
  254. Setup = 'EXENAME='current'\elemntry.exe;OBJECTID=<PMWTHR>;STARTUPDIR='current';ICONFILE='current'\PMWEATHR.ICO'
  255. result=SysCreateObject(classname,Title,Location,Setup,option)
  256.  
  257. /*   Turned off for now.  11-96
  258. Classname= 'WPProgram'
  259. Title =   'Weather Robot'
  260. Location =  '<WP_DESKTOP>'
  261. Setup = 'EXENAME='current'\Wthrrobo.EXE;OBJECTID=<WthrRobo>;STARTUPDIR='current';ICONFILE='current'\WthrRobo.ICO'
  262. result=SysCreateObject(classname,Title,Location,Setup,option)
  263. */
  264.  
  265.  
  266. RETURN 0
  267.