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

  1. /******************************************************************
  2. Description:    ObjectVision Installation exec
  3.  
  4. Details:        This exec creates a local directory where work
  5.                 files can be saved.  It adds this information to
  6.                 OS2.INI.  It also asks the user if he or she wants
  7.                 to copy the sample and demo programs locally.  This
  8.                 is necessary for them to run.  They will not run
  9.                 if started from the Vendor drive.
  10.  
  11. Dependencies:
  12.    Externals:   RXUTILS.DLL  - Part of VENDOR package.
  13.    Drive(s):    None
  14.    Directories: None
  15.    Window Type: FS/Win
  16.    App Title:   ObjectVision
  17.  
  18. Last Updated    10/1/92
  19. ******************************************************************/
  20.  trace 'O'
  21.  '@echo off'
  22.  
  23. call RxFuncAdd 'RXDIREXIST',  'RXUTILS', 'RXDIREXIST'
  24. call RxFuncAdd 'RXDRIVEMAP',  'RXUTILS', 'RXDRIVEMAP'
  25. call RxFuncAdd 'RXDRIVEINFO', 'RXUTILS', 'RXDRIVEINFO'
  26. call RxFuncAdd 'RXPAUSE',     'RXUTILS', 'RXPAUSE'
  27. call RxFuncAdd 'RXMKDIR',     'RXUTILS', 'RXMKDIR'
  28. call RxFuncAdd 'RXOS2INI',    'RXUTILS', 'RXOS2INI'
  29. call RxFuncAdd 'RXOS2VER',    'RXUTILS', 'RXOS2VER'
  30.  
  31. parse source . . exec
  32. path=left(exec, lastpos('\', exec))
  33. drive=left(path,2)
  34.  
  35. /* Give header */
  36. say
  37. say ' ObjectVision Installation exec'
  38. say ' ------------------------------'
  39. say
  40.  
  41. /*****************************************/
  42. /** Determine if OS/2 2.0 is being used **/
  43. /*****************************************/
  44.  
  45. if (RxOS2Ver() < 2.0) then do
  46.   say
  47.   say d2c(7)||' Error!'
  48.   say 'ObjectVision requires OS/2 2.0 or later in order to'
  49.   say 'run.  It will not run on earlier versions of OS/2.'
  50.   say
  51.   call RxPause 'Press any key to exit.'
  52.   'exit 10'
  53. end /* do */
  54.  
  55. /***********************************************/
  56. /** Check if a Local.Directory already exists **/
  57. /***********************************************/
  58.  
  59. Local.Directory = RxOS2Ini(, 'Directories', 'ObjectVision')
  60. if RxDirExist(Local.Directory)=1 then do
  61.    say ' Current ObjectVision local directory = 'Local.Directory
  62.    say
  63. end  /* if RxDirExist... */
  64.  
  65. /***************************************************************/
  66. /** Get the valid local drives, remove the VDISK, prompt user **/
  67. /***************************************************************/
  68.  
  69. DrvMap = RxDriveMap('C:', 'LOCAL' )
  70. parse upper value RxDriveInfo( right(DrvMap,2)) with . 'LABEL='label .
  71. if pos('VDISK', label)<>0 then DrvMap=left(DrvMap, length(DrvMap)-3)
  72.  
  73. /********************************************************/
  74. /** Prompt user for Local Directory.  Do until a valid **/
  75. /** local drive is used.                               **/
  76. /********************************************************/
  77.  
  78. say
  79. say ' Enter a local directory for your ObjectVision work files;'
  80. say ' i.e. D:\OBVISION'
  81. say ' Valid local Drives:' DrvMap
  82. say
  83.  
  84. /*****************************************************/
  85. /** Create Local Directory.  Add entry to OS2.INI.  **/
  86. /*****************************************************/
  87.  
  88. OK=0
  89. do until OK=1
  90.    Local.Directory = translate( LINEIN('STDIN') )
  91.    if POS( left(Local.Directory,2), DrvMap) <> 0 then
  92.       OK=1
  93.    else do
  94.       say
  95.       say d2c(7)||' Cannot create directory.  Try again...'
  96.       say
  97.       OK=0
  98.    end /* do */
  99.    if OK=1 then do
  100.       if Local.Directory<>'' then do
  101.          call RxMkDir Local.Directory
  102.          if RxDirExist(Local.Directory) then
  103.             call RxOS2Ini , 'Directories', 'ObjectVision', Local.Directory
  104.          if RxDirExist(Local.Directory)=0 then do
  105.             OK=0
  106.             say
  107.             say d2c(7)||' Cannot create directory.  Try again...'
  108.             say
  109.          end  /* do */
  110.       end /* do */
  111.    end /* do */
  112. end /* do until */
  113.  
  114. /*******************************************************************/
  115. /** Ask user if sample and Demo programs should be copied locally **/
  116. /*******************************************************************/
  117.  
  118. say
  119. say ' ObjectVision comes with several sample and demo programs.'
  120. say ' In order to use them they must be copied to your hard'
  121. say ' disk.  If you try to use the sample files from the Vendor'
  122. say ' drive, ObjectVision will hang and then close itself.  The'
  123. say ' files take up about 287KB of disk space.  If you choose'
  124. say ' to copy the files to your hard disk a SAMPLE subdirectory'
  125. say ' will be created under 'Local.Directory'.'
  126. say
  127. say ' Do you want to copy the sample programs to your.'
  128. say ' hard disk? (Y/N)'
  129. say
  130.  
  131. do until conv='Y' | conv='N'
  132.    conv = translate(left(linein(STDIN),1))
  133. end  /* do until... */
  134.  
  135. if (conv='Y') then do
  136.   call RxMkDir Local.Directory'\sample'
  137.   'copy 'path'sample\*.*' Local.Directory'\sample\ >NUL'
  138. end
  139.  
  140. say
  141. say 'ObjectVision is now ready to run.'
  142. say 'A reboot is not required.'
  143. call RxPause
  144. 'exit 0'
  145.