Installer.Uninstall(IDictionary) Method

Definition

When overridden in a derived class, removes an installation.

C#
public virtual void Uninstall(System.Collections.IDictionary savedState);

Parameters

savedState
IDictionary

An IDictionary that contains the state of the computer after the installation was complete.

Exceptions

The saved-state IDictionary might have been corrupted.

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

Examples

The following example demonstrates the Uninstall method of Installer. The Uninstall method is overridden in the derived class of Installer.

C#
// Override 'Uninstall' method of Installer class.
public override void Uninstall( IDictionary mySavedState )
{
   if (mySavedState == null)
   {
      Console.WriteLine("Uninstallation Error !");
   }
   else
   {
      base.Uninstall( mySavedState );
      Console.WriteLine( "The Uninstall method of 'MyInstallerSample' has been called" );
   }
}

Notes to Inheritors

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also