home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / disklib.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1994-09-16  |  2KB  |  64 lines

  1. /* Install Program for Disk Librarian Program */
  2.  
  3. IF RxFuncQuery('SysLoadFuncs') THEN
  4.     DO
  5.       CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  6.            CALL SysLoadFuncs
  7.     END
  8.  
  9.   '@Echo Off'
  10.  
  11.   Parse Source . . name_path
  12.   path = Left(name_path,LASTPOS("\", name_path))
  13.  
  14.   Parse Value SysTextScreenSize() with rows cols
  15.   'CLS'
  16.  
  17.   Say Center('┌───────────────────────────┐',cols-1)
  18.   Say Center('│Disk Librarian Installation│',cols-1)
  19.   Say Center('└───────────────────────────┘',cols-1)
  20.   Say ' '
  21.   Say Center('Please Enter the Path you wish to install Disk Librarian to.',cols)
  22.   Say Center('Press Enter for C:\DISKLIB',COLS)
  23.  
  24.   progpath=Linein()
  25.  
  26.   If progpath = '' Then
  27.    progpath = 'C:\DISKLIB'
  28.  
  29.  
  30.   rc=SysFileTree(progpath,progdir,'D')
  31.     If progdir.0 = 0 Then
  32.      Do
  33.        Say Center('Path 'progpath' Does not exists. Create it? Y/N',cols)
  34.        ans=SysGetKey('NoEcho')
  35.          If (ans='Y') | (ans='y') Then
  36.           Do
  37.            rc=SysMkDir(progpath)
  38.             If rc <> 0 Then
  39.              Do
  40.               Say Center('Error Creating Directory. RC = 'rc,cols)
  41.               Exit
  42.              End
  43.               Else
  44.                Say Center('Directory Created.',cols)
  45.           End
  46.            Else
  47.             Do
  48.              Say 'Installation Aborted'
  49.              Exit
  50.             End
  51.      End
  52.  
  53.     Say Center('Copying Files to 'Translate(progpath),cols)
  54.     '@Copy 'path'DiskLib.exe' progpath
  55.     '@Copy 'path'DiskLib.ico' progpath
  56.     '@Copy 'path'ReadMe' progpath
  57.     Say Center('Creating WorkPlace Shell Object...',cols)
  58.     If SysCreateObject('WPProgram','Disk Librarian','<WP_DESKTOP>','EXENAME='progpath'\DISKLIB.EXE') Then
  59.      Say Center('Program object created',cols)
  60.       Else
  61.        Say Center('Unable to create Program Object',cols)
  62.  
  63.  
  64.