home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / mynst105.zip / SAVEPRE.CMD < prev    next >
OS/2 REXX Batch file  |  1997-10-07  |  2KB  |  59 lines

  1. /* REXX *********************************************/
  2. /*                                                  */
  3. /* Program name: SAVEPRE                            */
  4. /* Function    : Save current installation - an     */
  5. /*               example for the pre-install exit   */
  6. /*                                                  */
  7. /* Syntax      : Call from the INSTALL.DAT via:     */
  8. /*    START_REXX_BY_START_INSTALL=SAVEPRE dest_path */
  9. /*                                                  */
  10. /* Changes     : No                                 */
  11. /*                                                  */
  12. /* Made use of GREED.  21 May 1996 / 19:50:29   JRK */
  13. /****************************************************/
  14.  
  15. Parse Arg destPath
  16. /*-------------(Write lines into file)--------------*/
  17. filename    = destPath'\install.log'
  18. rc = LineOut( filename, 'Destination Directory:' destPath)
  19.  
  20. /*==============(Exception handling)================*/
  21. Signal On Failure Name CLEARUP
  22. Signal On Halt    Name CLEARUP
  23. Signal On Syntax  Name CLEARUP
  24.  
  25. Call On NOTREADY
  26.  
  27. /*==========(Initialize RexxUtil support)===========*/
  28. If RxFuncQuery('SysLoadFuncs') Then Do
  29.   Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  30.   Call SysLoadFuncs
  31. End /* If RxFuncQuery... */
  32.  
  33. delRC = SysFileDelete( destPath'\greed.ini' )
  34. /*--------------(Make directory)---------------*/
  35. directory = destPath||'\SAVEPREV'
  36. rc = LineOut( filename, 'Save Directory:' directory )
  37. rc = SysMkDir( directory )
  38.   ret = LineOut( filename, 'Make Save Directory RC='rc )
  39. if rc = 0 Then Do
  40.   ret = LineOut( filename, 'Make Save Directory RC='rc )
  41.   rc = LineOut( filename, "Save" destPath||"\*.*" directory"\" )
  42.   "unpack" destPath||"\*.*" directory"\ >>NUL"
  43.   rc = LineOut( filename, 'Save Previous Installation RC='rc )
  44. End
  45. Else ret = LineOut( filename, 'Make Save Directory RC='rc )
  46.  
  47. /*----------(Set command for file system)-----------*/
  48. status = Stream( filename, 'C', 'Close' )
  49.  
  50. /*================(End this program)================*/
  51. Return
  52.  
  53. CLEARUP:
  54. Return
  55.  
  56. NOTREADY:
  57. Return
  58.  
  59.