home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / warpdbmp.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1994-11-11  |  9KB  |  258 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 AutoBMP'
  25. say ''
  26. say 'Determining System Configuration Please Wait...'
  27. map = sysdrivemap()
  28. say ''
  29. say 'Available Drives: ' map
  30. say ''
  31. maxdrive = words(map)
  32. vxdll.0 = 0
  33. env             = 'OS2ENVIRONMENT'
  34. tst_path        = value('PATH',,env)
  35. os2             = pos(':\OS2',tst_path)
  36. os2             = os2 - 1
  37. os2drv          = substr(tst_path,os2,1)
  38. configfile      = os2drv||':\config.sys'
  39. vxdll. = 0
  40. ok              = sysfiletree(configfile,'vxdll','F')
  41.  
  42. if vxdll = 0 then do
  43.     say 'Can not locate OS/2 Config.Sys file, to determine LIBPATH,'
  44.     say 'VROBJ.DLL, must be manually installed into a directory'
  45.     say 'in the current OS/2 LIBPATH'
  46.     end
  47. else do
  48.     found = 'no'
  49.     say 'Searching system for VROBJ.DLL'
  50.     say ''
  51.     do until found = 'yes'
  52.         dllpath    = linein(configfile)
  53.         test       = lines(configfile)
  54.         parse value dllpath with one '=' foundlibpath
  55.             select
  56.                 when translate(one) = 'LIBPATH' then do
  57.                     curr = setlocal()
  58.                     os2drv||':'
  59.                     'cd \os2\dll'
  60.                     'set testpath='||foundlibpath
  61.                     filedll = syssearchpath('TESTPATH','VROBJ.DLL')
  62.                     curr = endlocal()
  63.                     if filedll = '' then do
  64.                             say 'Copying VrObj.dll to' os2drv||':\os2\dll'
  65.                             say ''
  66.                             say 'This DLL is required for AutoBMP to function, by copying'
  67.                             say 'it to this directory, AutoBMP will be able to be started'
  68.                             say 'without rebooting the system to initialize the dll location.'
  69.                             say ''
  70.                             say 'After AutoBMP is installed you may move this DLL to any'
  71.                             say 'directory that is in your OS/2 LIBPATH, if you wish.'
  72.                             say ''
  73.                             'copy vrobj.dll' os2drv||':\os2\dll'
  74.                             say ''
  75.                             end
  76.                     else do
  77.                         say 'Installed: ' filedll
  78.                         call SysFileTree filedll,dllspec
  79.                         if word(dllspec.1,3) = 819593 then do
  80.                             say 'The required version of VROBJ.DLL is already installed'
  81.                             say ''
  82.                             end
  83.                         else do
  84.                             period = pos('.',filedll)
  85.                             old = left(filedll,period)||'OLD'
  86.                             say 'A different version of VROBJ.DLL is already installed on this system.'
  87.                             say 'Copying current VROBJ.DLL to VROBJ.OLD.'
  88.                             'copy' filedll old
  89.                             say 'Installing new VROBJ.DLL to:' filedll
  90.                             copy vrobj.dll filedll
  91.                             say 'If after this installation is complete, if other'
  92.                             say 'applications that use VROBJ.DLL do not function'
  93.                             say 'correctly, you may need to replace this DLL with'
  94.                             say 'your original which was saved as VROBJ.OLD.  If there'
  95.                             say 'no problems with your current applications, then'
  96.                             say 'the VROBJ.OLD can be safely deleted from your system.'
  97.                             say ''
  98.                             say ''
  99.                             end
  100.                         end
  101.                     leave
  102.                 end
  103.                 when test = 0 then do
  104.                     call lineout configfile
  105.                     say 'Can not locate LIBPATH in Config.Sys file,'
  106.                     say 'use manual install method for VROBJ.DLL file'
  107.                     end
  108.                 otherwise
  109.                     nop
  110.             end
  111.     end
  112. call lineout configfile
  113.  
  114. /* search for old installation of AutoBMP */
  115. dirs = '\autobmp \warpbmp'
  116. do k = 1 to words(dirs)
  117.     searchdir = word(dirs,k)
  118.     searchdir1 = translate(substr(searchdir,2))
  119.     do i = 1 to words(map)
  120.         autodir. = 0
  121.         ok = sysfiletree(word(map,i)||searchdir,'autodir','DO')
  122.         if autodir.0 > 0 then do
  123.             do j = 1 to autodir.0
  124.                 if pos(searchdir1,translate(autodir.j)) > 0 then do
  125.                     say 'Prior version of AutoBMP or WARPedBMP found, updating Directory.'
  126.                     olddir = 'yes'
  127.                     installdir = autodir.j
  128.                     installdrive = left(autodir.j,2)
  129.                     leave k
  130.                 end
  131.             end
  132.         end
  133.     end
  134. end
  135.  
  136. if olddir \= 'yes' then do
  137.     say 'The drive/directory that WARPedBMP is installed on will also contain the'
  138.     say 'archive file containing all of the BitMaps that are stored by WARPedBMP.'
  139.     say ''
  140.     say 'Select a drive that has sufficient space for this archive.'
  141.     say ''
  142.     say 'Enter Drive Letter To Install WARPedBMP On: (do not include the colon)'
  143.     say 'Example:  D'
  144.     baddrive = 1
  145.     do while baddrive = 1
  146.         pull installdrive
  147.         select
  148.             when installdrive \= '' & length(installdrive) > 1 then
  149.                 say 'Drive letter incorrect, do not include the colon'
  150.             when verify(translate(installdrive),'CDEFGHIJKLMNOPQRSTUVWXYZ') \= 0 then
  151.                 say 'Drive letter invalid, select a different drive'
  152.             when installdrive = '' then
  153.                 say 'You must select a drive letter to continue the installation'
  154.             otherwise do
  155.                 status = sysdriveinfo(installdrive||':')
  156.                 if status \= '' then
  157.                     baddrive = 0
  158.                 else
  159.                     say 'Drive selection is not valid, select a valid drive to continue'
  160.             end
  161.         end
  162.     end
  163.     installdrive = installdrive||':'
  164.     installdir = installdrive||'\WARPBMP'
  165.  
  166.     call SySCLs
  167.     say 'Creating WARPBMP Directory & Installing Files'
  168.     md installdir
  169. end
  170.  
  171. say ''
  172. 'copy WARPBMP.exe' installdir
  173. 'copy WARPBMP.ico' installdir
  174. say ''
  175. 'copy *.txt'       installdir
  176. say ''
  177. 'copy *.me'        installdir
  178. say ''
  179. 'copy *.new'       installdir
  180.  
  181. if olddir = 'yes' then do
  182.     ok = sysfiledelete(installdir||'\autobmp.exe')
  183.     ok = sysfiledelete(installdir||'\autobmp.ico')
  184.     curr = setlocal()
  185.     installdrive
  186.     'cd' installdir
  187.     ok = sysfiletree('autobmp.ini','test','F')
  188.     if test.0 > 0 then
  189.         'rename autobmp.ini warpbmp.ini > nul'
  190.     ok = sysfiletree('autobmp.zip','test','F')
  191.     if test.0 > 0 then
  192.         'rename autobmp.zip warpbmp.zip > nul'
  193.     ok = sysfiletree('autobmp.lzh','test','F')
  194.     if test.0 > 0 then
  195.         'rename autobmp.lzh warpbmp.lzh > nul'
  196.     os2drv||':'
  197.     'cd \os2\bitmap'
  198.     ok = sysfiletree('autobmp.bmp','test','F')
  199.     if test.0 > 0 then
  200.         'copy autobmp.bmp warpbmp.bmp > nul'
  201.     curr = endlocal()
  202. end
  203.  
  204.  
  205.  
  206.  
  207. say ''
  208. say 'Creating/Updating WARPedBMP DesKTop OBject'
  209.  
  210. classname='WPProgram'
  211. title=    'WARPedBMP '
  212. location= '<WP_DESKTOP>'
  213. setup=    'OBJECTID=<AutoBMP>;'||,
  214.          'EXENAME='installdir||'\WARPBMP.EXE;'||,
  215.          'STARTUPDIR='installdir||';'
  216. Call BldObj
  217. say ''
  218. say 'Creating/Updating WARPBMP StartUp Folder OBject'
  219. classname='WPProgram'
  220. title=    'WARPedBMP Chg DeskTop'
  221. location= '<WP_START>'
  222. setup=    'OBJECTID=<AutoBMP_Change>;'||,
  223.          'EXENAME='installdir||'\WARPBMP.EXE;'||,
  224.          'PARAMETERS=CHANGE;'||,
  225.          'STARTUPDIR='installdir||';'
  226. Call BldObj
  227.  
  228. say ''
  229. say 'WARPedBMP has been installed, starting WARPedBMP and processing WARPBMP.INI'
  230. say ''
  231. installdrive
  232. 'cd' installdir
  233. WARPBMP
  234. say ''
  235. say 'WARPedBMP installation complete...'
  236. say ''
  237. end
  238.  
  239. Return
  240.  
  241. /* Build Object(s), this builds the objects and displays the completion
  242.    status of each build.*/
  243.  
  244. BldObj:
  245.  
  246. call charout,'Building: 'title
  247.  
  248. /* Build object using REPLACE as duplicateflag */
  249.  
  250. result = SysCreateObject(classname, title, location, setup, 'R')
  251.  
  252. If result=1 Then call charout ,'...   Object created!'
  253.   Else           call charout ,'...   Not created! Return code='result
  254.  
  255. Say '';
  256. Return
  257.  
  258.