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

  1. /******************************************************************
  2.  
  3. Description:    IBM EASEL Install Exec.
  4.  
  5. Details:        This exec creates a local EASEL directory,
  6.                 adds the current drive/dir path to the
  7.                 LIBPATH of the CONFIG.SYS if needed, and
  8.                 install the AEDD_OS2.SYS device driver if
  9.                 needed.
  10.  
  11.                 Local directory info is stored in OS2.INI.
  12.  
  13. Dependencies:
  14.    Externals:   RXUTILS.DLL - Part of VENDOR package.
  15.                 LIBEDIT.CMD - Part of VENDOR package.
  16.                 ANSI state must be on.
  17.    Drive(s):    User must always use same drive.
  18.    Directories: Assumes DLLs and EXEs in root directory of
  19.                  assigned drive.
  20.    Window Type: FS/Win
  21.    App Title:   None
  22.  
  23. Last Updated:   4/10/91
  24. ******************************************************************/
  25. trace 'O'
  26. '@echo off'
  27.  
  28. /* Load external funcs */
  29. call RxFuncAdd 'RXCLS',      'RXUTILS', 'RXCLS'
  30. call RxFuncAdd 'RXOS2INI',   'RXUTILS', 'RXOS2INI'
  31. call RxFuncAdd 'RXREAD',     'RXUTILS', 'RXREAD'
  32. call RxFuncAdd 'RXWRITE',    'RXUTILS', 'RXWRITE'
  33. call RxFuncAdd 'RXDIREXIST', 'RXUTILS', 'RXDIREXIST'
  34. call RxFuncAdd 'RXMKDIR',    'RXUTILS', 'RXMKDIR'
  35.  
  36. /* Give panel */
  37. call RxCls
  38. Esc = d2c(27)
  39. say  Esc'['1';37;'41'm'      /* White on Red */
  40. say ' ********************************************************************* '
  41. say ' *         IBM EASEL Version 1.1 for OS/2 Extended Edition           * '
  42. say ' ********************************************************************* '
  43. say '                                                                       '
  44. say ' EASEL Package Installation Procedure:                                 '
  45. say '                                                                       '
  46. say ' The EASEL Package requires that this program will always run from     '
  47. say ' the same Network Drive.  A reboot of your IBM PS/2 computer will be   '
  48. say ' necessary before IBM EASEL will run successfully.                     '
  49. say '                                                                       '
  50. say ' This Installation Program will modify your CONFIG.SYS to include this '
  51. say ' EASEL Network Drive along your LIBPATH statement.  It will also ask   '
  52. say ' you for a subdirectory in which your EASEL Source Code can be placed. '
  53. say ' If you have an Audio Visual Card or plan on using the Audio Visual    '
  54. say ' capabilities of EASEL a Device Driver needs to copied to your         '
  55. say ' workstation and a DEVICE statement will be added to your CONFIG.SYS.  '
  56. say  Esc'['1';37;'40'm'      /* White on Black */
  57. 'pause'
  58.  
  59.  
  60. /* Setup vars */
  61. EaselInit = RxOS2Ini(, 'EASEL', 'EASELINIT')
  62. parse source . . exec
  63. Edr=left(exec, lastpos('\', exec))
  64.  
  65.  
  66. /* Give user info as to what we are doing */
  67.   if EaselInit = 1 then do
  68.      call RxCls
  69.      say
  70.      call SayCnC ' You are about to re-install the IBM EASEL product.    '
  71.      call SayCnC ' All previous information and setup you have installed '
  72.      call SayCnC ' will be erased.                                       '
  73.      say
  74.   end
  75.   else do            /* New Installation */
  76.      call RxCls
  77.      say
  78.      call SayCnC ' This is the first time you have run EASEL from the  '
  79.      call SayCnC ' Vendor Server.                                      '
  80.      call SayCnC '                                                     '
  81.      call SayCnC ' The LIBPATH statement must be modified to find the  '
  82.      call SayCnC ' Easel DLLs.                                         '
  83.      call SayCnC '                                                     '
  84.      call SayCnC ' If using the Audio Visual Adapter, it is required   '
  85.      call SayCnC ' that a device driver be loaded via your CONFIG.SYS. '
  86.      call SayCnC '                                                     '
  87.      call SayCnC ' ** You must reboot after the Easel installation **  '
  88.      say
  89.   end
  90.  
  91.   say 'Should the EASEL Initialization proceed (Y/N)?'
  92.   do until OK='Y' | OK='N'
  93.     OK = translate(linein('STDIN'))
  94.   end
  95.   if OK <> 'Y' then do
  96.      say d2c(7)
  97.      call SayCnC 'IBM EASEL Initialization Aborted'
  98.      say
  99.      'pause'
  100.      'exit 0'
  101.   end
  102.  
  103.  
  104. /* Proceed with EASEL Installation */
  105. /* Add this network drive to the LIBPATH */
  106.    call LIBEDIT Edr';' 'A'
  107.  
  108.    call RxOS2Ini , 'EASEL', 'EASELINIT', 1
  109.    Local.Directory = RxOS2Ini(, 'EASEL', 'WORKDIR')
  110.  
  111.    if rxDirExist(Local.Directory) = 1 then do
  112.       say 'Do you want to continue using 'Local.Directory' as your'
  113.       say 'EASEL Source Code path (Y/N)? '
  114.       do until OK='Y' | OK='N'
  115.         OK = translate(linein('STDIN'))
  116.       end
  117.       if OK = 'N' then
  118.          Local.Directory = ''
  119.    end
  120.    else Local.Directory = ''
  121.  
  122.  
  123. /* Get local directory spec from user */
  124.    if Local.Directory = '' then do
  125.       do forever
  126.          say 'Enter a local directory where your IBM EASEL Source Code will'
  127.          say 'be saved:'
  128.          Local.Directory =  linein('STDIN')
  129.          call rxMkDir Local.Directory
  130.          if rxDirExist(Local.Directory) then do
  131.             call RxOS2Ini , 'EASEL', 'WORKDIR', Local.Directory
  132.             leave
  133.          end
  134.          else do
  135.             say d2c(7)
  136.             call SayCnC ' Invalid Path.  Please enter a valid path. '
  137.             say
  138.          end
  139.       end
  140.    end
  141.  
  142. bdr=RxBootDrive()
  143. /* Read config.sys */
  144.    rc = RxRead(bdr'\CONFIG.SYS', Config)
  145.    if rc > 0 then do
  146.       say d2c(7)
  147.       call SayCnC 'Problem reading CONFIG.SYS file.'
  148.       say
  149.       'pause'
  150.       'exit 0'
  151.    end
  152.  
  153.  
  154. /* Search for AEDD_OS2 device drivers */
  155.    do index = 1 to Config.0
  156.       parse var Config.index 'DEVICE=' DevStatement
  157.       if Pos('AEDD_OS2.SYS',DevStatement) <> 0 then do
  158.          Audio = 'TRUE'
  159.          leave
  160.       end
  161.    end
  162.  
  163.  
  164. /* Add DD if not found */
  165.    if AUDIO <> 'TRUE' then do
  166.       say 'Would you like to install the Audio Visual Adapter Card device'
  167.       say 'driver (Y/N)?'
  168.       do until OK='Y' | OK='N'
  169.         OK = translate(linein('STDIN'))
  170.       end
  171.       if OK = 'Y' then do
  172.          do forever
  173.             say 'Enter a local path where the AEDD_OS2.SYS file will be'
  174.             say 'copied:'
  175.             AVC.Directory = linein('STDIN')
  176.             call rxMkDir AVC.Directory
  177.             if rxDirExist(AVC.Directory) = 1 then do
  178.                if right( AVC.Directory, 1) <> '\' then
  179.                   AVC.Directory=AVC.Directory'\'
  180.                'COPY 'Edr'AEDD_OS2.SYS 'AVC.Directory'AEDD_OS2.SYS'
  181.                TheEnd = Config.0
  182.                Config.TheEnd = 'DEVICE='AVC.Directory'AEDD_OS2.SYS'
  183.                call RxWrite 'C:\CONFIG.SYS',Config, 1, TheEnd, 'A'
  184.                leave
  185.             end
  186.             else do
  187.                say d2c(7)
  188.                call SayCnC ' Invalid Path.  Please enter a valid path. '
  189.             end
  190.          end
  191.       end
  192.    end
  193.  
  194.  
  195. /* Tell user we are done */
  196.   say d2c(7)
  197.   call SayCnC 'IBM EASEL Installation Complete.'
  198.   call SayCnc
  199.   call SayCnC 'You will have to reboot your computer'
  200.   call SayCnC 'to activate the new configuration.'
  201.   say
  202. 'pause'
  203. 'exit'
  204.  
  205.  
  206.  
  207. /*** Little proc for saying a line with style ***/
  208. SayCnC:     /* Say with Centering and Color */
  209. parse arg str
  210.   say Esc'[1;37;41m'||center(str, 79)||Esc'[1;37;40m'
  211. return
  212.