home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netdor3.zip / VNDINST / FRNTENDS / OIS / PACKINST.CMD next >
OS/2 REXX Batch file  |  1996-04-04  |  6KB  |  190 lines

  1. /******************************************************************
  2.  
  3. Description:    IBM Image Support Run Exec.
  4.  
  5. Details:        This exec sets up the appropriate IBM OS/2 Image
  6.                 Support defaults.
  7.                 The required device driver files are copied locally.
  8.  
  9.                 The \DLL directory of the remote drive is added
  10.                 to the user's LIBPATH if needed.
  11.  
  12. Dependencies:
  13.    Externals:   RXUTILS.DLL - Part of VENDOR package.
  14.                 LIBEDIT.CMD - Part of VENDOR package.
  15.    Drive(s):    Always use same drive.
  16.    Directories: DLLs and EXEs in current directory.
  17.    Window Type: FS/Win
  18.    App Title:   None
  19.  
  20. Last Updated:   9/9/91
  21. ******************************************************************/
  22. '@echo off'
  23. trace 'o'
  24.  
  25. /* Load externals */
  26. call RxFuncAdd 'RXDIREXIST',  'RXUTILS', 'RXDIREXIST'
  27. call RxFuncAdd 'RXMKDIR',     'RXUTILS', 'RXMKDIR'
  28. call RxFuncAdd 'RXPAUSE',     'RXUTILS', 'RXPAUSE'
  29. call RxFuncAdd 'RXWRITE',     'RXUTILS', 'RXWRITE'
  30. call RxFuncAdd 'RXOS2INI',    'RXUTILS', 'RXOS2INI'
  31.  
  32.  
  33. /*  Get drive letter being used */
  34. parse upper source . . drv
  35. Odr=left(drv , lastpos('\', drv))
  36. OS2='OS2ENVIRONMENT'
  37.  
  38. /** Say what we are about to do **/
  39. say
  40. say ' OS/2 Image Support Installation'
  41. say ' -------------------------------'
  42. say
  43.  
  44. /* Give current setting */
  45. Local.Directory = RxOS2Ini(, 'Directories', 'OIS')
  46. if RxDirExist(Local.Directory)=1 then do
  47.   say 'Current local directory = 'Local.Directory
  48. end
  49.  
  50.  
  51. /* Query user */
  52. do forever
  53.      say
  54.      say ' Enter a local directory where local Image Support files may be stored:'
  55.      Local.Directory = linein('STDIN')
  56.      if Local.Directory<>'' then do
  57.        call rxMkDir Local.Directory
  58.        if rxDirExist(Local.Directory) then do
  59.           call RxOS2Ini , 'Directories', 'OIS', Local.Directory
  60.           leave
  61.        end
  62.      end
  63.      say d2c(7)
  64.      say ' Invalid Directory.  Please enter a valid directory.'
  65. end  /* Do Forever */
  66.  
  67. isys=0
  68. do until WhichEQ='3'
  69.   say 'IBM OS/2 Image Support supports the following types of equipment:'
  70.   say '     1. IBM scanners or video adapter cards'
  71.   say '     2. Non-IBM scanners or video adapter cards'
  72.   say '     3. No more Equipment'
  73.   say;
  74.   say 'Select an equipment type you wish to install'
  75.   do until WhichEQ='1' | WhichEQ='2' | WhichEQ='3'
  76.     WhichEQ = left(linein(STDIN),1)
  77.   end
  78.   if WhichEQ='1' then
  79.     do until WhichIBM='5'
  80.       say 'IBM OS/2 Image Support supports the following types of IBM equipment:'
  81.       say '     1. IBM 3119 PageScanner'
  82.       say '     2. IBM 3118 scanner'
  83.       say '     3. IBM 3117 scanner'
  84.       say '     4. IBM Video Capture Adapter/A'
  85.       say '     5. No more Equipment'
  86.       say;
  87.       say 'Select an IBM equipment type you wish to install'
  88.       do until WhichIBM='1' | WhichIBM='2' | WhichIBM='3' | WhichIBM='4' | WhichIBM='5'
  89.         WhichIBM = left(linein(STDIN),1)
  90.       end
  91.       if WhichIBM='1' then do
  92.          isys = isys+1
  93.          Driver.isys='EQP3119.SYS '
  94.          say 'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  95.          'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  96.          end
  97.       else if WhichIBM='2' | WhichIBM='3' then do
  98.          isys = isys+1
  99.          Driver.isys='AODB3118.SYS '
  100.          say 'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  101.          'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  102.          end
  103.       else if WhichIBM='4' then do
  104.          isys = isys+1
  105.          Driver.isys='ICDD.SYS '
  106.          say 'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  107.          'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  108.          end
  109.     end
  110.   else if WhichEQ='2' then do
  111.     do until WhichSCAN='8'
  112.       say 'IBM OS/2 Image Support supports the following types of Non-IBM equipment:'
  113.       say '     1. HP ScanJet scanner'
  114.       say '     2. HP ScanJet Plus'
  115.       say '     3. Howtek ScanMaster scanner'
  116.       say '     4. Howtek ScanMaster II scanner'
  117.       say '     5. Sharp JX-300 scanner'
  118.       say '     6. Sharp JX-450 scanner'
  119.       say '     7. SYLVIA/MC camera adapter card'
  120.       say '     8. No more Equipment'
  121.       say;
  122.       say 'Select an IBM equipment type you wish to install'
  123.       do until WhichSCAN='1' | WhichSCAN='2' | WhichSCAN='3' | WhichSCAN='4' |,
  124.                WhichSCAN='5' | WhichSCAN='6' | WhichSCAN='7' | WhichSCAN='8'
  125.         WhichSCAN = left(linein(STDIN),1)
  126.       end
  127.       if WhichSCAN='1' | WhichSCAN='2' then do
  128.          isys = isys+1
  129.          Driver.isys='SJDRIVER.SYS '
  130.          say 'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  131.          'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  132.          end
  133.       else if WhichSCAN='7' then do
  134.          isys = isys+1
  135.          Driver.isys='EQPSYLVA.SYS'
  136.          say 'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  137.          'COPY 'Odr||Driver.isys||Local.Directory'\*.*>nul 2>&1'
  138.          end
  139.       else if WhichScan<>'8' then do
  140.          say 'Be sure to install the manufacture supplied software for the'
  141.          say 'Howtek or Sharp Scanners, if you have not already done so.'
  142.          say;
  143.          end
  144.     end
  145.   end  /* Do */
  146. end
  147. Driver.0=isys
  148.  
  149. /* Add new drivers to CONFIG.SYS */
  150. if Driver.0<>0 then do
  151.   isys=1
  152.   do until isys > Driver.0
  153.      Driver.isys='DEVICE='Local.Directory'\'Driver.isys
  154.      isys=isys+1
  155.   end /* do */
  156.   call RxWrite 'C:\CONFIG.SYS', Driver,,,'A'
  157.   if rc then do
  158.     say rc
  159.     say 'Error Writing C:\CONFIG.SYS!  Nothing updated'
  160.     'exit'
  161.   end
  162. end
  163.  
  164. /** Add drive entry to LIBPATH statement if needed **/
  165. call LIBEDIT Odr'DLL' 'A' 'E'  /* External Rexx Exec */
  166. LibEditRC = value('LIBEDIT.RC',,'OS2ENVIRONMENT')
  167. if LibEditRC=0 | Driver.0<>0 then do
  168.   say d2c(7)
  169.   say ' Important Note:'
  170.   say ' ---------------'; say
  171.   if LibEditRC=0 then do
  172.     say ' The 'Odr'DLL entry has just been added to the LIBPATH statement'
  173.     say ' of your C:\CONFIG.SYS file.'
  174.   end
  175.   if Driver.0<>0 then
  176.     say ' A OIS Device driver was just added to your CONFIG.SYS.'
  177.   say;
  178.   say 'You must reboot before OS\2 Image Support will run correctly.'
  179.   say
  180. end
  181. else do
  182.   say
  183.   say ' OS/2 Image Support is ready to run on your PC.'
  184.   say
  185. end
  186. say 'Press Enter to finish updating local workstation.'
  187. call RxPause
  188. 'OISINI'
  189. 'exit'
  190.