home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / csinst.zip / savepre.cmd < prev    next >
OS/2 REXX Batch file  |  1996-09-12  |  2KB  |  62 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     :                                    */
  11. /*                                                  */
  12. /* Made use of GREED.  21 May 1996 / 19:50:29   JRK */
  13. /****************************************************/
  14. Parse Arg destPath
  15. /*-------------(Write lines into file)--------------*/
  16. filename    = destPath'\install.log'
  17. rc = LineOut( filename, 'Destination Directory:' destPath)
  18.  
  19. /*==============(Exception handling)================*/
  20. Signal On Failure Name CLEARUP
  21. Signal On Halt    Name CLEARUP
  22. Signal On Syntax  Name CLEARUP
  23.  
  24. Call On NOTREADY
  25.  
  26. /*==========(Initialize RexxUtil support)===========*/
  27. If RxFuncQuery('SysLoadFuncs') Then Do
  28.   Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  29.   Call SysLoadFuncs
  30. End /* If RxFuncQuery... */
  31.  
  32. delRC = SysFileDelete( destPath'\greed.ini' )
  33. /*--------------(Make directory)---------------*/
  34. directory = destPath||'\SAVEPREV'
  35. rc = LineOut( filename, 'Save Directory:' directory )
  36. rc = SysMkDir( directory )
  37. rc = LineOut( filename, 'Make Save Directory RC='rc )
  38. rc = LineOut( filename, "Save" destPath||"\*.*" directory"\" )
  39. "unpack" destPath||"\*.*" directory"\"
  40. rc = LineOut( filename, 'Save Previous Installation RC='rc )
  41.  
  42. /*----------(Set command for file system)-----------*/
  43. status = Stream( filename, 'C', 'Close' )
  44.  
  45. /*================(End this program)================*/
  46. Return
  47.  
  48. CLEARUP:
  49.   Say 'GREED001E - Break, Failure or Syntax Error'
  50. Return
  51.  
  52. NOTREADY: Procedure
  53.   Parse Var response . ':' errcode
  54.   Say SysGetMessage(errcode)
  55.   Say
  56.   Call ,"Retry (Y/N)? "
  57.   Pull response
  58.   If response = 'N' Then Exit
  59.  
  60. Return
  61.  
  62.