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

  1. /******************************************************************
  2.  
  3. Description:    WordPerfect 5.0 Installation Exec.
  4.  
  5. Details:        This exec is used to install WordPerfect.
  6.  
  7.                 Installation really only consists of asking the
  8.                 user for a local directory spec in which to
  9.                 store local files.  This info is stored in OS2.INI.
  10.  
  11. Dependencies:
  12.    Externals:   RXUTILS.DLL - Part of VENDOR package.
  13.    Drive(s):    None
  14.    Directories: All DLL and EXE files in same directory.
  15.    Window Type: FS/WIN
  16.    App Title:   None
  17.  
  18. Last Updated:   9/24/92
  19. ******************************************************************/
  20. '@ECHO OFF'
  21. trace 'o'
  22.  
  23. call RxFuncAdd 'RXDIREXIST',  'RXUTILS', 'RXDIREXIST'
  24. call RxFuncAdd 'RXPAUSE',     'RXUTILS', 'RXPAUSE'
  25. call RxFuncAdd 'RXMKDIR',     'RXUTILS', 'RXMKDIR'
  26. call RxFuncAdd 'RXOS2INI',    'RXUTILS', 'RXOS2INI'
  27. call RxFuncAdd 'RXDRIVEMAP',  'RXUTILS', 'RXDRIVEMAP'
  28. call RxFuncAdd 'RXDRIVEINFO', 'RXUTILS', 'RXDRIVEINFO'
  29.  
  30. say
  31. say ' WordPerfect 5.0 Installation'
  32. say ' ----------------------------'
  33. say
  34.  
  35. /***********************************************/
  36. /** Check if a Local.Directory already exists **/
  37. /***********************************************/
  38.  
  39. Local.Directory = RxOS2Ini(, 'Directories', 'WordPerfect')
  40. if Local.Directory = '$RXERROR' then do
  41.    Local.Directory = RxOS2Ini(, 'WORDPERFECT', 'WORKDIR')
  42.    if Local.Directory <> '$RXERROR' then do
  43.       call RxOS2Ini , 'Directories', 'WordPerfect', Local.Directory
  44.       call RxOS2Ini , 'WORDPERFECT', 'WORKDIR', '$RXDEL'
  45.    end
  46. end
  47.  
  48. if rxDirExist(Local.Directory)=1 then do
  49.    say ' Current WordPerfect 5.0 local directory = 'Local.Directory
  50.    say
  51. end  /* if rxDirExist... */
  52.  
  53. /***************************************************************/
  54. /** Get the valid local drives, remove the VDISK, prompt user **/
  55. /***************************************************************/
  56.  
  57. DrvMap = RxDriveMap('C:', 'LOCAL' )
  58. parse upper value RxDriveInfo( right(DrvMap,2)) with . 'LABEL='label .
  59. if pos('VDISK', label)<>0 then DrvMap=left(DrvMap, length(DrvMap)-3)
  60.  
  61. /********************************************************/
  62. /** Prompt user for Local Directory.  Do until a valid **/
  63. /** local drive is used.                               **/
  64. /********************************************************/
  65.  
  66. say
  67. say ' Enter a local directory for your WordPerfect work files;'
  68. say ' i.e. D:\WP50'
  69. say ' Valid local Drives:' DrvMap
  70. say
  71.  
  72. /*****************************************************/
  73. /** Create Local Directory.  Add entry to OS2.INI.  **/
  74. /*****************************************************/
  75.  
  76. OK=0
  77. do until OK=1
  78.    Local.Directory = translate( LINEIN('STDIN') )
  79.    if POS( left(Local.Directory,2), DrvMap) <> 0 then
  80.       OK=1
  81.    else do
  82.       say
  83.       say d2c(7)||' Cannot create directory.  Try again...'
  84.       say
  85.       OK=0
  86.    end /* do */
  87.    if OK=1 then do
  88.       if Local.Directory<>'' then do
  89.          call rxMkDir Local.Directory
  90.          if RxDirExist(Local.Directory) then
  91.             call RxOS2Ini , 'Directories', 'WordPerfect', Local.Directory
  92.          if RxDirExist(Local.Directory)=0 then do
  93.             OK=0
  94.             say
  95.             say d2c(7)||' Cannot create directory.  Try again...'
  96.             say
  97.          end  /* do */
  98.       end /* do */
  99.    end /* do */
  100. end /* do until */
  101.  
  102. /* Give message */
  103. say
  104. say ' WordPerfect is now ready to run.'
  105. say ' A reboot is not required.'
  106. say
  107. call RxPause
  108. 'exit'
  109.