home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: OtherApp / OtherApp.zip / cdmaker.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-04-04  |  2KB  |  85 lines

  1. /*
  2.  * Cirrus Technology, Inc.      1995
  3.  *
  4.  * install.cmd - Determines the product being installed based on the 
  5.  *               .TXT file it finds in the current area or on the current
  6.  *               diskette.  Passes the install program info for generating 
  7.  *               .err & .log files of the installation.
  8.  *
  9.  */
  10.  
  11. call RXFuncAdd 'SysLoadFuncs', 'REXXUTIL', 'SysLoadFuncs'
  12. call SysLoadFuncs
  13.  
  14. /* trace ?all */
  15.  
  16. starting_dir = directory()
  17.  
  18. rc = SysFileTree('cirrus.exe', found., 'FO')
  19. do while found.0 = 0
  20.    say
  21.    say "*** ATTENTION ***"
  22.    say "Install files not found in current directory."
  23.    say "Enter the location of the Cirrus Technology product install files"
  24.    say " (full drive and path name)"
  25.    say
  26.    say "Enter X to exit this install"
  27.    say
  28.    pull thislocation
  29.  
  30.    xx = pos(":",thislocation)
  31.    if xx = 0 then do
  32.       say
  33.       say "No drive specified."
  34.       say
  35.       found.0 = 0
  36.    end
  37.    else do
  38.       /* parse out the drive and then set the default to that drive */
  39.       thisdrive = substr(thislocation,1,xx)
  40.       cmdstr = thisdrive
  41.       address cmd cmdstr
  42.       thisdir = substr(thislocation,xx+1)
  43.       cmdstr = "cd "thisdir
  44.       address cmd cmdstr
  45.       rc = SysFileTree('cirrus.exe', found., 'FO')
  46.    end 
  47. end /* do */
  48.  
  49. rc = SysFileTree('*.txt', found., 'FO')
  50.  
  51. if found.0 = 1 then do
  52.    /* remove the drive designation from the filename */
  53.    x = (pos('\',found.1)) + 1
  54.    filename = substr(found.1,x,length(found.1))
  55. end  /* Do */
  56.  
  57. /* get the current directory and then force it to uppercase */
  58. curdir = DIRECTORY();
  59. curdir = translate(curdir)
  60.  
  61. filename = strip(filename)
  62. filename = substr(filename,1,length(filename)-4)
  63. errfile = "c:\"filename".err"
  64. logfile = "c:\"filename".log"
  65. /*
  66. rc = SysFileTree(errfile, found.0, 'F')
  67. if found.0 = 1 then do
  68.    cmdstr = "del "errfile
  69.    address cmd cmdstr
  70. end
  71. */  /* Do */
  72.  
  73. cmdstr = "cirrus /L1:"errfile" /L2:"logfile" /s:"curdir
  74. address cmd cmdstr
  75.  
  76. xx = pos(":",starting_dir)
  77. /* parse out the drive and then set the default back to the original area */
  78. thisdrive = substr(starting_dir,1,xx)
  79. cmdstr = thisdrive
  80. address cmd cmdstr
  81. thisdir = substr(starting_dir,xx+1)
  82. cmdstr = "cd "thisdir
  83. address cmd cmdstr
  84.  
  85.