Undo and Redo in ART

In ART Undo is used for:
- the Registry roll-back to some previous state
- programs and hardware uninstalling
It is helpful to use Undo as an uninstaller when installed program has not uninstaller itself or when its uninstaller works incorrectly, i.e. removes its keys and values from the Registry incompletely.

Redo is used for:
- the Registry roll-back to its previous state after using Undo
- programs and hardware installing
It is advisable to use Redo as an installer by system administrators, when it is necessary to install one and the same program on several users’ PCs.

Undo and Redo are available only from Compare window. To generate Undo/ Redo for chosen keys use function of comparing for certain key and possibility to exclude some subkeyes from comparing. There are two Undo/Redo methods in ART.

The first method is creation *.REG and *.INF files and execution them later independently from ART, e.g. with Windows Explorer. You can apply this method by pressing buttons with hints Save to Undo files and Save to Redo files in Compare window.

In addition, these files can be used for:
- viewing changes in text format (unlike the trees, presented in ART)
- storing changes compactly independently from ART
- editing prior to executing.

Executing *.REG and *.INF files doesn't always produce excellent results due to some bugs - limitations - in programs which process these files. For example, too long lines are truncated. Or, if the key has Value Name = (Default), and Value Data = (value not set) it is impossible to restore the value (Default) - (value not set) without deleting the key.

That is why Undo and Redo functions that change the Registry directly were introduced. They employ the second method. In Compare window they are represented by buttons with hints Undo into Registry! and Redo into Registry!

How Undo and Redo works in ART?

What will occur to the Registry after executing *.REG (*.INF) files or after using the function of direct Registry changing - Undo/Redo into Registry!?
Undo modifies the Registry key, including its subkeys, for which comparison was done. This key becomes absolutely similar to the key from Old copy of the Registry.

    Undo modifies the Registry in the following ways:
- removes from the Registry keys marked with yellow bulb as well as values in the green bulb marked keys on the Added tab
- adds keys and values marked on the Deleted tab to the Registry
- changes data "2" to data "1" in values on the Distinction in Data tab.

    Redo modifies the Registry in the following ways:
- adds marked keys and values in the marked keys on the Added tab to the Registry
- removes marked keys and values on the Deleted tab from the Registry
- changes data "1" to data "2" in values on the Distinction in Data tab.




Creating Undo/Redo Files

Undo/Redo files can be created only from Comparison window by clicking Save to Undo files or Save to Redo files button. Undo/Redo files consist of two file types: *.REG and *.INF. *.INF file is optional, which means that you can set it or not and not to use it. These *.REG and *.INF files are created in text format required by your system.

*.REG file begins with DELETE section, which is followed by ADD section
Delete section of Undo.REG file contains Keys and Values, which will be removed from the Registry, found in the New copy and not found in the Old one.
Add section of Undo.REG file contains Keys and Value Names found in the Old copy and not found in the New one, as well as Value Data from the Old copy modified in the New one.

*.INF file (optional) contains Values found in the New copy and not found in the Old one.
When Undo.REG and Undo.INF (optional) are executed, e.g. from Windows Explorer, the Registry is changed from New version to the Old one.

Redo files are created in the same way, but their function is reverse.
Delete section of Redo.REG file contains Keys and Values, which will be removed from the Registry, found in the Old copy and not found in the New one.
Add section of Redo.REG file contains Keys and Value Names found in the New copy and not found in the Old one, as well as Value Data from the New copy modified in the Old one.

CAUTION! Use Undo/Redo files to modify the Registry only when it is absolutely necessary, having checked them before, if possible. Make sure you’ve backed up the Registry files (system.dat, user.dat, system.da0, user.da0) before using Undo/Redo files.

Why does one have to use *.INF files sometimes?

Unfortunately, it is impossible always to use only a single *.REG file, because *.REG file is unable to remove some Values from the Registry. When such events happens you should use *.INF file.
Deleting by means of ART come the following way, while using *. REG file. When it is necessary to remove keys and values ART uses an undocumented feature of *.REG file. ART inserts the minus before the KeyPath in *.REG file and the appropriate key is removed from the Registry after executing this *.REG file. ART also uses this feature for deleting values in the keys, which have no subkeys.

For example, if you need to remove values Test2 Test4 in the key:

KEY_LOCAL_MACHINE\SOFTWARE\Test
test1=val1
test2=val2
test3=val3
test4=val4

ART puts the following lines in REG file:

[-KEY_LOCAL_MACHINE\SOFTWARE\Test]
; Values to be deleted: "Test2" "Test4"
[KEY_LOCAL_MACHINE\SOFTWARE\Test]
test1=val1
test3=val3
where "; Values to be deleted: "Test2" "Test4"" - a comment.

If the key contains subkeys, for example: [HKEY_LOCAL_MACHINE\SOFTWARE\Test\Subkey1] then, removal of values of such keys using this method makes *.REG file very big and hard to read, since all the subkeys are to be restored too. In this instance ART will insert the following lines of comments into REG file:

[KEY_LOCAL_MACHINE\SOFTWARE\Test]
; Value should be deleted: "Test2"
; Value should be deleted: "Test4"

These values could be removed either manually or automatically by creating and executing *.INF file. *.INF file will be created under the same name as *.REG file, when you generate Undo/Redo file by clicking on Yes in the following message:

 

 

Undo/Redo functions

Undo function is advisable to use provided the "New" copy is actually new, i.e. newly scanned, and reflects the current state of the Registry. Only in that case the proper return to the previous version of the key would take place. If time since last scan exceeds 10 minutes, you will see the warning. Of course, the time limit (10 minutes) is not a criterion reliable enough to ensure that the key is up-to-date, it might be as well you to control this yourself.

So, if you have scanned a new copy of the Registry and immediately ran comparing, without having been switched to any task before comparison, you may well admit that you have compared current state of the Registry to some previous state. Should it be necessary, you can return to that previous state correctly.

You may ask, why Undo is available when the "New" copy is not up-to-date? The answer is that it is not always necessary to change only fresh version, you may well need to change some old ones. For example, if you compare copy of the Registry scanned before installation of a program to the copy scanned after it, Compare function shows changes that appeared due to installation of that program. In that case Undo removes only changes caused by the program installation.

Contrariwise, Redo in this instance does the same changes to the Registry, as installation of the program did.

Unlike Undo, Redo is time senseless i.e. gives no warning if the time since New copy scan exceeds 10 minutes.

In general, it is advisable to use Redo only when settings of a program are damaged and you want to restore them and have the Registry copies scanned prior to installation of the program and after it.


[ Previous | Index| Next ]