Installer.Uninstall(IDictionary) 方法

定义

在派生类中重写时,移除安装。

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

参数

savedState
IDictionary

IDictionary 包含安装完成后计算机的状态。

例外

保存的状态 IDictionary 可能已损坏。

卸载时发生异常。 忽略该异常,卸载继续进行。 但是,卸载完成后应用程序可能未完全卸载。

示例

以下示例演示 的 UninstallInstaller方法。 方法 Uninstall 在 的 Installer派生类中被重写。

   // Override 'Uninstall' method of Installer class.
public:
   virtual void Uninstall( IDictionary^ mySavedState ) override
   {
      if ( mySavedState == nullptr )
      {
         Console::WriteLine( "Uninstallation Error !" );
      }
      else
      {
         Installer::Uninstall( mySavedState );
         Console::WriteLine( "The Uninstall method of 'MyInstallerSample' has been called" );
      }
   }
// 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" );
   }
}
' Override 'Uninstall' method of Installer class.
Public Overrides Sub Uninstall(mySavedState As IDictionary)
   If mySavedState Is Nothing Then
      Console.WriteLine("Uninstallation Error !")
   Else
      MyBase.Uninstall(mySavedState)
      Console.WriteLine("The Uninstall method of 'MyInstallerSample' has been called")
   End If
End Sub

继承者说明

适用于

另请参阅