home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / csinst.zip / restorep.cmd < prev    next >
OS/2 REXX Batch file  |  1996-09-12  |  2KB  |  50 lines

  1. /* REXX *********************************************/
  2. /*                                                  */
  3. /* Program name: RSTRFNC                            */
  4. /* Function    : Restore Backup after the failing   */
  5. /*               installation                       */
  6. /*               example for the post-install-      */
  7. /*               failure exit                       */
  8. /*                                                  */
  9. /* Syntax      : Call from the INSTALL.DAT via:     */
  10. /*         START_REXX_IF_FAILURE=RESTOREP dest_path */
  11. /*                                                  */
  12. /* Changes     :                                    */
  13. /*                                                  */
  14. /* Made use of GREED.  21 May 1996 / 21:22:36   JRK */
  15. /****************************************************/
  16. Parse Arg destPath
  17. /*-------------(Write lines into file)--------------*/
  18. filename    = destPath'\install.log'
  19. rc = LineOut( filename, 'Destination Directory:' destPath)
  20.  
  21. /*==============(Exception handling)================*/
  22. Signal On Failure Name CLEARUP
  23. Signal On Halt    Name CLEARUP
  24. Signal On Syntax  Name CLEARUP
  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. /*--------------(Save directory)---------------*/
  33. directory = destPath||'\SAVEPREV'
  34. /*-----------(Find file/Set attributes)-------------*/
  35. rc = SysFileTree( directory||'\*.*', fileList, 'FO' )
  36. Do i = 1 To fileList.0
  37.   /*------------------(copy file)-------------------*/
  38.   a = "unpack" fileList.i destPath||"\"
  39.   "unpack" fileList.i destPath||"\"
  40.   If rc = 0 Then delRC = SysFileDelete( fileList.i )
  41.   Queue Date( S ) Time() a || ', RC='rc
  42. End /* If ... */
  43.  
  44. /*================(End this program)================*/
  45. Return
  46.  
  47. CLEARUP:
  48.   Say 'GREED001E - Break, Failure or Syntax Error'
  49. Return
  50.