home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rxcp290.zip / install.cmd < prev    next >
OS/2 REXX Batch file  |  1996-05-03  |  2KB  |  68 lines

  1. /* Installation for RxCP290 Package */
  2.  
  3. call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  4. call SysLoadFuncs
  5.  
  6. /* Get directory name to install to */
  7.  
  8. parse upper arg todir trash
  9.  
  10. /* Get directory name to install from */
  11.  
  12. parse upper source os src command
  13. index = pos('INSTALL.CMD', command)
  14. index = index-1
  15. FromDir = SubStr(command,1, index)
  16.  
  17. /* Get Boot Drive, location of /OS2/APPS/DLL */
  18.  
  19. BootDrive = FileSpec('Drive', Value('SYSTEM_INI',,'OS2ENVIRONMENT'))
  20. SysFile = BootDrive||'\CONFIG.SYS'
  21. rc = SysFileSearch('LIBPATH=',SysFile,'val.','N')
  22. index = pos('\OS2\APPS\DLL', val.1)
  23. index = index - 2
  24. DllToDir = Substr(val.1,index,15)
  25.  
  26. /* If no todir specified on command line, set to Bootdrive\RxCP290 */
  27.  
  28. if ToDir = "" then 
  29.    ToDir = BootDrive||'\RxCP290'
  30.    
  31. /* Check with user if this installation is OK */
  32.  
  33. Call SysCls
  34. Say '                          RxCP290 Installation Program'
  35. Say 
  36. Say
  37. Say 'Installing From: ' FromDir
  38. Say
  39. Say 'Installing To:   ' ToDir
  40. Say
  41. Say
  42. Say 'Is this OK?: (y/n)'
  43. ans = SysGetKey('NOECHO')
  44. ans = C2D(ans)
  45. if (ans = 89 |  ans = 121) then nop
  46. else do
  47.   Say 'Aborting Installation!'
  48.   exit
  49. end
  50.  
  51. /* copy DLL to DllToDir  */
  52.  
  53. Say
  54. Say 'Copying RxCP290 DLL to 'DllToDir'.'
  55. Say
  56. '@copy 'FromDir'rxcp290.dll 'DllToDir' >nul' 
  57.  
  58. /* Make ToDir */
  59. Say 'Creating 'ToDir' Subdirectory.'
  60. Say
  61. rc = SysMkDir(ToDir)
  62.  
  63. /* Copy everything to ToDir */
  64.  
  65. Say 'Copying RxCP290 Utilities, Examples, and Documentation to 'ToDir'.' 
  66. '@copy 'FromDir'*.* 'ToDir' >nul'
  67. Say
  68. Say 'Installation of RxCP290 Complete!'