home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rexx / rexxfunc / ezrxfunc / install.cmd < prev    next >
OS/2 REXX Batch file  |  1993-07-28  |  1KB  |  62 lines

  1. /*
  2.  * install.cmd -- Asks you what kind of compiler you have, then installs
  3.  *                the correct files for you.
  4.  */
  5.  
  6. main:
  7.     address CMD
  8.  
  9.     if( DirExists( 'o' ) = 0 )then
  10.       do
  11.         'mkdir o'
  12.       end
  13.     else
  14.       do
  15.         'echo y | del o\*.*'
  16.       end
  17.     
  18.     if( DirExists( 'oprod' ) = 0 )then
  19.       do
  20.         'mkdir oprod'
  21.       end
  22.     else
  23.       do
  24.         'echo y | del oprod\*.*'
  25.       end
  26.  
  27.     say "Are you using the WATCOM compiler or the CSET/2 compiler?"
  28.     parse pull compiler
  29.  
  30.     if( left( translate( strip( compiler ) ), 1 ) = 'W' )then
  31.       do
  32.         'copy watcom\*.cmd'
  33.         say ""
  34.         say "Don't forget to set the WATCOM environment variable!"
  35.         say ""
  36.         say "WATCOM C 9.5 users should see the README file for some"
  37.         say "further instructions."
  38.       end
  39.     else
  40.       do
  41.         'copy cset\*.cmd'
  42.       end
  43.     
  44.     exit
  45.  
  46. /*
  47.  * DirExists -- Returns 1 if the given directory exists.
  48.  */
  49.  
  50. DirExists: procedure
  51.     dir     = arg(1)
  52.     old_dir = directory()
  53.     exists  = 0
  54.  
  55.     if( dir <> '' & directory( dir ) <> '' )then
  56.         exists = 1
  57.  
  58.     call directory old_dir
  59.  
  60.     return exists
  61.  
  62.