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

  1. /******************************************************************
  2.  
  3. Description:    SPM/2 Install Exec
  4.  
  5. Details:        This exec installs the SPM/2 package available on
  6.                 OS2PROD on a users machine.
  7.  
  8.                 To do this, the following will be done:
  9.  
  10.                  - Ask the user for a local directory for storing
  11.                    the SPM/2 files.
  12.  
  13.                  - Run the self-extracting PKZIP file to place the
  14.                    files in the specified local directory.
  15.  
  16.                  - Run the SPM2INST program to setup CONFIG.SYS
  17.                    with the appropriate device drivers and create
  18.                    an SPM/2 PM group.
  19.  
  20. Dependencies:
  21.    Externals:   RXUTILS.DLL  - See RXUTILS PACKAGE on OS2TOOLS.
  22.    Drive(s):    None
  23.    Directories: None
  24.    Window Type: FS/Win
  25.    App Title:   None
  26.  
  27. Author:         Thomas J. Rogers
  28.  
  29. Support Level:  Append questions to VENDOR FORUM.
  30.  
  31. ******************************************************************/
  32. trace 'O'
  33. '@echo off'
  34.  
  35. /*************************************/
  36. /** Load RxUtils external functions **/
  37. /*************************************/
  38. call RxFuncAdd 'RXSAY',           'RXUTILS', 'RXSAY'
  39. call RxFuncAdd 'RXMKDIR',         'RXUTILS', 'RXMKDIR'
  40. call RxFuncAdd 'RXWRITE',         'RXUTILS', 'RXWRITE'
  41. call RxFuncAdd 'RXGETKEY',        'RXUTILS', 'RXGETKEY'
  42.  
  43. if (rxOs2Ver() < 2.0) then do
  44.  
  45. /************************/
  46. /** Give the user info **/
  47. /************************/
  48.    'cls'
  49.    say
  50.    say
  51.    say 'VENDOR is about to install SPM/2 on your system.'
  52.    say
  53.    say 'Once installed, you may run SPM/2 WITHOUT running VENDOR'
  54.    say 'by simply starting it from the SPM/2 Desktop Manager group'
  55.    say 'that will be created by the installation process.'
  56.    say
  57.    'pause'
  58.  
  59. /**********************************/
  60. /** Get dir to store SPM/2 files **/
  61. /**********************************/
  62.    do until RxDirExist(SpmDir)=1
  63.      do until resp='Y'
  64.        'cls'
  65.        say
  66.        call RxSay 'Enter drive and directory in which to install SPM/2 > '
  67.        SpmDir = translate(linein('STDIN'))
  68.        say
  69.        call RxSay 'Install SPM/2 in the 'SpmDir' subdirectory?  (Y/N) > '
  70.        do until resp='Y' | resp='N'
  71.          resp = translate(RxGetKey('NOECHO'))
  72.        end
  73.        say resp
  74.        if resp='Y' then do
  75.           call MakeDir SpmDir
  76.           if RxDirExist(SpmDir)=0 then do
  77.             say d2c(7)
  78.             say 'Directory specified could not be created.  Please try something else.'
  79.             'pause'
  80.           end
  81.        end
  82.      end
  83.    end
  84.  
  85. /************************************************************/
  86. /** Create the files by running self-extracting PKZIP file **/
  87. /************************************************************/
  88.    'SPM2 'SpmDir
  89.  
  90. /************************************/
  91. /** Run SPM/2 installation program **/
  92. /************************************/
  93.    SpmDir'\SPMINST 'SpmDir
  94.  
  95. /***************/
  96. /** Give info **/
  97. /***************/
  98.    say d2c(7)
  99.    say
  100.    say 'An SPM/2 group has been added to the Desktop Manager.'
  101.    say 'You may run SPM/2 from there without having to use VENDOR.'
  102.    say
  103.    say 'Device drivers have been added to your CONFIG.SYS.'
  104.    say 'You will have to reboot your system before SPM/2 will'
  105.    say 'run properly.'
  106.    say
  107.    say 'Press any key to exit...'
  108.    'pause>nul'
  109.    'exit'
  110. end
  111. else do
  112.    say
  113.    say ' SPM/2 currently does not run on OS/2 2.0.  Nothing will'
  114.    say ' be installed.  When a new version of SPM/2 which does run'
  115.    say ' on OS/2 2.0 is available it will be announced in CORE NEWS.'
  116.    say
  117.    call RxPause
  118.    'exit'
  119. end  /* Do */
  120.  
  121. /**********************************************************
  122. * MakeDir directory                                       *
  123. *                                                         *
  124. * Purpose:                                                *
  125. *   This procedure will make a directory specification no *
  126. *   matter how many directories deeep it might span,      *
  127. **********************************************************/
  128. MakeDir: procedure expose IC.
  129.  parse upper arg dir
  130.  do i=1 to length(dir)
  131.   if right(left(dir,i),1)='\' then
  132.     call RxMkDir(left(dir, i-1))
  133.  end
  134.  call RxMkDir dir
  135. return
  136.  
  137.  
  138.  
  139.  
  140.