home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 1994 December / SOFM_Dec1994.bin / pc / os2 / autobmp / install.cmd < prev    next >
Encoding:
Text File  |  1994-09-20  |  7.1 KB  |  198 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 'AutoBMP must be installed manually, see AutoBMP installation'
  11.     say 'instructions for this procedure.'
  12.     say ' '
  13.     exit
  14. end
  15. parse source na na drivepath
  16. found = lastpos('\',drivepath)
  17. drivepath = left(drivepath,(found - 1))
  18. colon = pos(':',drivepath)
  19. instldrv = left(drivepath,colon)
  20. instldrv
  21. 'cd' drivepath
  22.  
  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. say 'The drive/directory that AutoBMP is installed on will also contain the'
  114. say 'archive file containing all of the BitMaps that are stored by AutoBMP.'
  115. say ''
  116. say 'Select a drive that has sufficient space for this archive.'
  117. say ''
  118. say 'Enter Drive Letter To Install AutoBMP On: (do not include the colon)'
  119. say 'Example:  D'
  120. baddrive = 1
  121. do while baddrive = 1
  122.     pull instldrive
  123.     select
  124.         when instldrive \= '' & length(instldrive) > 1 then
  125.             say 'Drive letter incorrect, do not include the colon'
  126.         when verify(translate(instldrive),'ABCDEFGHIJKLMNOPQRSTUVWXYZ') \= 0 then
  127.             say 'Drive letter invalid, select a different drive'
  128.         when instldrive = '' then
  129.             say 'You must select a drive letter to continue the installation'
  130.         otherwise do
  131.             status = sysdriveinfo(instldrive||':')
  132.             if status \= '' then
  133.                 baddrive = 0
  134.             else
  135.                 say 'Drive selection is not valid, select a valid drive to continue'
  136.         end
  137.     end
  138. end
  139. call SySCLs
  140. say 'Creating AutoBMP Directory & Installing Files'
  141. md instldrive||':\autobmp > nul'
  142. say ''
  143. 'copy autobmp.exe' instldrive||':\autobmp'
  144. 'copy autobmp.ico' instldrive||':\autobmp'
  145. say ''
  146. 'copy *.txt'       instldrive||':\autobmp '
  147. say ''
  148. 'copy read*.*'     instldrive||':\autobmp '
  149. say ''
  150. say 'Creating AutoBMP DesKTop OBject'
  151.  
  152. classname='WPProgram'
  153. title=    'AutoBMP '
  154. location= '<WP_DESKTOP>'
  155. setup=    'OBJECTID=<AutoBMP>;'||,
  156.           'EXENAME='instldrive||':\autobmp\autobmp.EXE;'||,
  157.           'STARTUPDIR='instldrive||':\autobmp;'
  158. Call BldObj
  159. say ''
  160. say 'Creating AutoBMP StartUp Folder OBject'
  161. classname='WPProgram'
  162. title=    'AutoBMP Chg DeskTop'
  163. location= '<WP_START>'
  164. setup=    'OBJECTID=<AutoBMP_Change>;'||,
  165.           'EXENAME='instldrive||':\autobmp\autobmp.EXE;'||,
  166.           'PARAMETERS=CHANGE;'||,
  167.           'STARTUPDIR='instldrive||':\autobmp;'
  168. Call BldObj
  169.  
  170. say ''
  171. say 'AutoBMP has been installed, starting AutoBMP and creating AutoBMP.INI'
  172. say ''
  173. instldrive||':'
  174. cd instldrive||':\autobmp'
  175. autobmp
  176. say ''
  177. say 'AutoBMP installation complete...'
  178. say ''
  179. Return
  180.  
  181. /* Build Object(s), this builds the objects and displays the completion
  182.    status of each build.*/
  183.  
  184. BldObj:
  185.  
  186. call charout,'Building: 'title
  187.  
  188. /* Build object using REPLACE as duplicateflag */
  189.  
  190. result = SysCreateObject(classname, title, location, setup, 'R')
  191.  
  192. If result=1 Then call charout ,'...   Object created!'
  193.   Else           call charout ,'...   Not created! Return code='result
  194.  
  195. Say '';
  196. Return
  197.  
  198.