Bewerken

Share via


AssemblyInstaller.Uninstall(IDictionary) Method

Definition

Removes an installation.

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

Parameters

savedState
IDictionary

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

Exceptions

The saved-state IDictionary might have been corrupted.

-or-

A file could not be found.

An error occurred in the BeforeUninstall event handler of one of the installers in the collection.

-or-

An error occurred in the AfterUninstall event handler of one of the installers in the collection.

-or-

An exception occurred while uninstalling. The exception is ignored and the uninstall continues. However, the application might not be fully uninstalled after the uninstall 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.

-or-

A file could not be deleted.

An exception occurred while uninstalling. The exception is ignored and the uninstall continues. However, the application might not be fully uninstalled after the uninstall completes.

Examples

In the following sample, the Uninstall method is called after installing and committing the assembly passed as the parameter to the constructor.

// Uninstall the 'MyAssembly_Uninstall' assembly.
myAssemblyInstaller->Uninstall( mySavedState );
// Uninstall the 'MyAssembly_Uninstall' assembly.
myAssemblyInstaller.Uninstall( mySavedState );
' Uninstall the 'MyAssembly_Uninstall' assembly.
myAssemblyInstaller.Uninstall(mySavedState)

Remarks

Call this method to remove a previously completed installation. If the Uninstall method fails for one of the installers in the collection, it is still called for the remaining installers. A failed uninstallation does not roll back the computer to its pre-uninstallation state.

Note

Although the Install and Commit methods save the state of the computer after the installations, the file containing the IDictionary from the savedState parameter might have been deleted at some point after the installation was complete. If the file is deleted, the savedState parameter is null.

Applies to