Installer.Install(IDictionary) 方法

定义

在派生类中被重写时,执行安装。

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

参数

stateSaver
IDictionary

IDictionary 用于保存执行提交、回滚或卸载操作所需的信息。

例外

stateSaver 参数为 null

该集合的一个安装程序的 BeforeInstall 事件处理程序发生异常。

- 或 -

该集合的一个安装程序的 AfterInstall 事件处理程序发生异常。

示例

下面的示例演示 Install 类的 Installer 方法。 类派生自 Installer 基类, Install 方法将被重写。

   // Override the 'Install' method of the Installer class.
public:
   virtual void Install( IDictionary^ mySavedState ) override
   {
      Installer::Install( mySavedState );
      // Code maybe written for installation of an application.
      Console::WriteLine( "The Install method of 'MyInstallerSample' has been called" );
   }
// Override the 'Install' method of the Installer class.
public override void Install( IDictionary mySavedState )
{
   base.Install( mySavedState );
   // Code maybe written for installation of an application.
   Console.WriteLine( "The Install method of 'MyInstallerSample' has been called" );
}
' Override the 'Install' method of the Installer class.
Public Overrides Sub Install(mySavedState As IDictionary)
   MyBase.Install(mySavedState)
   ' Code maybe written for installation of an application.
   Console.WriteLine("The Install method of 'MyInstallerSample' has been called")
End Sub

继承者说明

适用于

另请参阅