Editare

Partajați prin


AssemblyInstaller.Rollback(IDictionary) Method

Definition

Restores the computer to the state it was in before the installation.

public:
 override void Rollback(System::Collections::IDictionary ^ savedState);
public override void Rollback (System.Collections.IDictionary savedState);
override this.Rollback : System.Collections.IDictionary -> unit
Public Overrides Sub Rollback (savedState As IDictionary)

Parameters

savedState
IDictionary

An IDictionary that contains the pre-installation state of the computer.

Exceptions

The savedState parameter is null.

-or-

The saved-state IDictionary might have been corrupted.

-or-

A file could not be found.

An exception occurred in the BeforeRollback event handler of one of the installers in the collection.

-or-

An exception occurred in the AfterRollback event handler of one of the installers in the collection.

-or-

An exception occurred during the Rollback(IDictionary) phase of the installation. The exception is ignored and the rollback continues. However, the computer might not be fully reverted to its initial state after the rollback completes.

-or-

Installer types were not found in one of the assemblies.

-or-

An instance of one of the installer types could not be created.

An exception occurred during the Rollback(IDictionary) phase of the installation. The exception is ignored and the rollback continues. However, the computer might not be fully reverted to its initial state after the rollback completes.

Examples

In the following sample, the Rollback method is called to undo the install process on the specified assembly.

// 'Rollback' the installation process.
myAssemblyInstaller->Rollback( mySavedState );
// 'Rollback' the installation process.
myAssemblyInstaller.Rollback( mySavedState );
' 'Rollback' the installation process.
myAssemblyInstaller.Rollback(mySavedState)

Remarks

A rollback restores the computer to the state it was in before the installation occurred. The Rollback method is called if the Install method of this Installer instance or of any installer in the installer collection fails to run correctly. Any exceptions generated by calling the Rollback method of an installer in the collection are ignored, and the rollback of the other installers continues.

Applies to