home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / mynst105.zip / RSTRFNC.CMD < prev    next >
OS/2 REXX Batch file  |  1997-10-07  |  3KB  |  65 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     : No                                 */
  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||'\*.fnc', fileList, 'FO' )
  36. Do i = 1 To fileList.0
  37.   name  = FileSpec( "Name", fileList.i )   /* FILENAME.EXT */
  38.   delRC = SysFileDelete( destPath'\'name )
  39.   a = "Delete: " destPath'\'name || ", RC="delRC
  40.   Queue Date( S ) Time() a 
  41.   /*------------------(copy file)-------------------*/
  42.   "unpack" fileList.i destPath||"\ >>NUL"
  43.   /* If rc = 0 Then delRC = SysFileDelete( fileList.i ) */
  44.   a = "unpack" fileList.i destPath||"\" || ", RC="rc
  45.   Queue Date( S ) Time() 'Restore:' a
  46. End /* If ... */
  47.  
  48. /*-------------(Remove directory)--------------*/
  49. /* rc = SysRmDir( directory ) */
  50.  
  51. /*---------------(Set key value data)---------------*/
  52. inifile = 'GREED.INI'    /* USER SYSTEM BOTH Pathname */
  53. appl    = 'GREEDX'       /* Application name          */
  54. key     = 'Cnr_BColor'   /* Key name                  */
  55. value = SysIni( inifile, appl, key )
  56. If value = '13160392' Then Do
  57.   value   = '13487565'     /* Key value data            */
  58.   result = SysIni( inifile, appl, key, value )
  59. End
  60. /*================(End this program)================*/
  61. Return
  62.  
  63. CLEARUP:
  64. Return
  65.