home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / warpxbmp.zip / INSTALLX.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-15  |  10KB  |  267 lines

  1. /* */
  2. '@echo off'
  3. cls
  4. say 'Starting The OS/2 RexxUtil Functions Please Wait...'
  5. say ''
  6. Call RxFuncadd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  7. Call SysLoadFuncs
  8. if RxFuncQuery('SysCls') <> 0 then do
  9.     say 'RexxUtil Functions Not Installed On This System!!!!!'
  10.     say 'These functions must be installed before WARPedBMP can be used.'
  11.     say 'The RexxUtil Functions are provided as part of OS/2, the.'
  12.     say 'OS/2 Selective Install Function can be used to install them.'
  13.     say ' '
  14.     exit
  15. end
  16. parse source na na drivepath
  17. found = lastpos('\',drivepath)
  18. drivepath = left(drivepath,(found - 1))
  19. colon = pos(':',drivepath)
  20. instldrv = left(drivepath,colon)
  21. instldrv
  22. 'cd' drivepath
  23. call SySCLs
  24. say 'INSTALLING WARPedBMP'
  25. say ''
  26. say 'This package was provided without the VXRexx Ver 2.0 VROBJ.DLL file,'
  27. say 'in order to save D/L time for those who already have this DLL installed'
  28. say 'on their systems.  If you do not have this DLL, then WARPedBMP will not'
  29. say 'run.  If you do not have this DLL, then you should obtain it from a BBS'
  30. say 'that carries it, or D/L the complete WARPedBMP package that includes this'
  31. say 'file.'
  32. say ''
  33. say ''
  34. say 'Determining System Configuration Please Wait...'
  35. call SysSleep 10
  36. map = sysdrivemap()
  37. say ''
  38. say 'Available Drives: ' map
  39. say ''
  40. maxdrive = words(map)
  41. vxdll.0 = 0
  42. env             = 'OS2ENVIRONMENT'
  43. tst_path        = value('PATH',,env)
  44. os2             = pos(':\OS2',tst_path)
  45. os2             = os2 - 1
  46. os2drv          = substr(tst_path,os2,1)
  47. configfile      = os2drv||':\config.sys'
  48. vxdll. = 0
  49. ok              = sysfiletree(configfile,'vxdll','F')
  50.  
  51. if vxdll = 0 then do
  52.     say 'Can not locate OS/2 Config.Sys file, to determine LIBPATH,'
  53.     say 'VROBJ.DLL, must be in a directory that is in the current'
  54.     say 'OS/2 LIBPATH'
  55.     end
  56. else do
  57.     found = 'no'
  58.     say 'Searching system for VROBJ.DLL'
  59.     say ''
  60.     do until found = 'yes'
  61.         dllpath    = linein(configfile)
  62.         test       = lines(configfile)
  63.         parse value dllpath with one '=' foundlibpath
  64.             select
  65.                 when translate(one) = 'LIBPATH' then do
  66.                     curr = setlocal()
  67.                     os2drv||':'
  68.                     'cd \os2\dll'
  69.                     'set testpath='||foundlibpath
  70.                     filedll = syssearchpath('TESTPATH','VROBJ.DLL')
  71.                     curr = endlocal()
  72.                     if filedll = '' then do
  73.                             say 'The DLL file VROBJ.DLL cannot be located on your system.'
  74.                             say ''
  75.                             say 'This DLL is required for WARPedBMP to function, it is provided'
  76.                             say 'as part of VXRexx or may be downloaded from many BBSs.'
  77.                             say ''
  78.                             say 'After installing version 2 or later of this DLL on your system'
  79.                             say 'rerun this install program to install WARPedBMP on your system.'
  80.                             say ''
  81.                             say 'The VROBJ.DLL was not included with this copy of WARPedBMP, in order'
  82.                             say 'to save d/l time for those that already have this DLL installed on'
  83.                             say 'their systems.  If you do not have this DLL and can not find a source'
  84.                             say 'for it, you should download the version of WARPedBMP that includes this'
  85.                             say 'DLL as part of the package.  This version should be available on the'
  86.                             say 'BBS from which you received this version that you have now.'
  87.                             exit
  88.                             end
  89.                     else do
  90.                         say 'Installed: ' filedll
  91.                         call SysFileTree filedll,dllspec
  92.                         if word(dllspec.1,3) = 819593 then do
  93.                             say 'The required version of VROBJ.DLL is already installed'
  94.                             say ''
  95.                             end
  96.                         else do
  97.                             say 'A different version of VROBJ.DLL was found on this system,'
  98.                             say 'other than the one that WARPedBMP was compiled with.'
  99.                             say 'If after this installation is complete, should WARPedBMP'
  100.                             say 'not perform correctly, a version of VROBJ.DLL Ver 2.0 or'
  101.                             say 'newer should be installed.  This version should be'
  102.                             say 'available from the BBS that you obtained this copy of'
  103.                             say 'WARPedBMP from, if it is not you should d/l the complete'
  104.                             say 'WARPedBMP package that contains this DLL.'
  105.                             say ''
  106.                             say ''
  107.                             end
  108.                         end
  109.                     leave
  110.                 end
  111.                 when test = 0 then do
  112.                     call lineout configfile
  113.                     say 'Can not locate LIBPATH in Config.Sys file,'
  114.                     say 'use manual install method for VROBJ.DLL file'
  115.                     end
  116.                 otherwise
  117.                     nop
  118.             end
  119.     end
  120.  
  121. call lineout configfile
  122.  
  123. /* search for old installation of AutoBMP */
  124. dirs = '\autobmp \warpbmp'
  125. do k = 1 to words(dirs)
  126.     searchdir = word(dirs,k)
  127.     searchdir1 = translate(substr(searchdir,2))
  128.     do i = 1 to words(map)
  129.         autodir. = 0
  130.         ok = sysfiletree(word(map,i)||searchdir,'autodir','DO')
  131.         if autodir.0 > 0 then do
  132.             do j = 1 to autodir.0
  133.                 if pos(searchdir1,translate(autodir.j)) > 0 then do
  134.                     say 'Prior version of AutoBMP or WARPedBMP found, updating Directory.'
  135.                     olddir = 'yes'
  136.                     installdir = autodir.j
  137.                     installdrive = left(autodir.j,2)
  138.                     leave k
  139.                 end
  140.             end
  141.         end
  142.     end
  143. end
  144.  
  145. if olddir \= 'yes' then do
  146.     say 'The drive/directory that WARPedBMP is installed on will also contain the'
  147.     say 'archive file containing all of the BitMaps that are stored by WARPedBMP.'
  148.     say ''
  149.     say 'Select a drive that has sufficient space for this archive.'
  150.     say ''
  151.     say 'Enter Drive Letter To Install WARPedBMP On: (do not include the colon)'
  152.     say 'Example:  D'
  153.     baddrive = 1
  154.     do while baddrive = 1
  155.         pull installdrive
  156.         select
  157.             when installdrive \= '' & length(installdrive) > 1 then
  158.                 say 'Drive letter incorrect, do not include the colon'
  159.             when verify(translate(installdrive),'CDEFGHIJKLMNOPQRSTUVWXYZ') \= 0 then
  160.                 say 'Drive letter invalid, select a different drive'
  161.             when installdrive = '' then
  162.                 say 'You must select a drive letter to continue the installation'
  163.             otherwise do
  164.                 status = sysdriveinfo(installdrive||':')
  165.                 if status \= '' then
  166.                     baddrive = 0
  167.                 else
  168.                     say 'Drive selection is not valid, select a valid drive to continue'
  169.             end
  170.         end
  171.     end
  172.     installdrive = installdrive||':'
  173.     installdir = installdrive||'\WARPBMP'
  174.  
  175.     call SySCLs
  176.     say 'Creating WARPBMP Directory & Installing Files'
  177.     md installdir
  178. end
  179.  
  180. say ''
  181. 'copy WARPBMP.exe' installdir
  182. 'copy WARPBMP.ico' installdir
  183. say ''
  184. 'copy *.txt'       installdir
  185. say ''
  186. 'copy *.me'        installdir
  187. say ''
  188. 'copy *.new'       installdir
  189.  
  190. if olddir = 'yes' then do
  191.     ok = sysfiledelete(installdir||'\autobmp.exe')
  192.     ok = sysfiledelete(installdir||'\autobmp.ico')
  193.     curr = setlocal()
  194.     installdrive
  195.     'cd' installdir
  196.     ok = sysfiletree('autobmp.ini','test','F')
  197.     if test.0 > 0 then
  198.         'rename autobmp.ini warpbmp.ini > nul'
  199.     ok = sysfiletree('autobmp.zip','test','F')
  200.     if test.0 > 0 then
  201.         'rename autobmp.zip warpbmp.zip > nul'
  202.     ok = sysfiletree('autobmp.lzh','test','F')
  203.     if test.0 > 0 then
  204.         'rename autobmp.lzh warpbmp.lzh > nul'
  205.     os2drv||':'
  206.     'cd \os2\bitmap'
  207.     ok = sysfiletree('autobmp.bmp','test','F')
  208.     if test.0 > 0 then
  209.         'copy autobmp.bmp warpbmp.bmp > nul'
  210.     curr = endlocal()
  211. end
  212.  
  213.  
  214.  
  215.  
  216. say ''
  217. say 'Creating/Updating WARPedBMP DesKTop OBject'
  218.  
  219. classname='WPProgram'
  220. title=    'WARPedBMP '
  221. location= '<WP_DESKTOP>'
  222. setup=    'OBJECTID=<AutoBMP>;'||,
  223.          'EXENAME='installdir||'\WARPBMP.EXE;'||,
  224.          'STARTUPDIR='installdir||';'
  225. Call BldObj
  226. say ''
  227. say 'Creating/Updating WARPBMP StartUp Folder OBject'
  228. classname='WPProgram'
  229. title=    'WARPedBMP Chg DeskTop'
  230. location= '<WP_START>'
  231. setup=    'OBJECTID=<AutoBMP_Change>;'||,
  232.          'EXENAME='installdir||'\WARPBMP.EXE;'||,
  233.          'PARAMETERS=CHANGE;'||,
  234.          'STARTUPDIR='installdir||';'
  235. Call BldObj
  236.  
  237. say ''
  238. say 'WARPedBMP has been installed, starting WARPedBMP and processing WARPBMP.INI'
  239. say ''
  240. installdrive
  241. 'cd' installdir
  242. WARPBMP
  243. say ''
  244. say 'WARPedBMP installation complete...'
  245. say ''
  246. end
  247.  
  248. Return
  249.  
  250. /* Build Object(s), this builds the objects and displays the completion
  251.    status of each build.*/
  252.  
  253. BldObj:
  254.  
  255. call charout,'Building: 'title
  256.  
  257. /* Build object using REPLACE as duplicateflag */
  258.  
  259. result = SysCreateObject(classname, title, location, setup, 'R')
  260.  
  261. If result=1 Then call charout ,'...   Object created!'
  262.   Else           call charout ,'...   Not created! Return code='result
  263.  
  264. Say '';
  265. Return
  266.  
  267.