Installer.OnAfterInstall(IDictionary) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
引发 AfterInstall 事件。
protected:
virtual void OnAfterInstall(System::Collections::IDictionary ^ savedState);
protected virtual void OnAfterInstall(System.Collections.IDictionary savedState);
abstract member OnAfterInstall : System.Collections.IDictionary -> unit
override this.OnAfterInstall : System.Collections.IDictionary -> unit
Protected Overridable Sub OnAfterInstall (savedState As IDictionary)
参数
- savedState
- IDictionary
IDictionary在属性中包含的Installers所有安装程序完成其安装之后,该计算机包含的状态。
示例
以下示例演示了该方法 OnAfterInstall 。 此方法在派生类中被重写。 提供空间以添加在方法中 OnAfterInstall 安装后要执行的步骤。
// Override the 'OnAfterInstall' method.
protected:
virtual void OnAfterInstall( IDictionary^ savedState ) override
{
Installer::OnAfterInstall( savedState );
// Add steps to be done after the installation is over.
Console::WriteLine( "OnAfterInstall method of MyInstaller called" );
}
// Override the 'OnAfterInstall' method.
protected override void OnAfterInstall(IDictionary savedState)
{
base.OnAfterInstall(savedState);
// Add steps to be done after the installation is over.
Console.WriteLine("OnAfterInstall method of MyInstaller called");
}
' Override the 'OnAfterInstall' method.
Protected Overrides Sub OnAfterInstall(savedState As IDictionary)
MyBase.OnAfterInstall(savedState)
' Add steps to be done after the installation is over.
Console.WriteLine("OnAfterInstall method of MyInstaller called")
End Sub
注解
此方法是在运行此实例的所有安装程序的方法之后 Install 调用的 InstallerCollection 。
引发事件会通过委托调用事件处理程序。 有关详细信息,请参阅 处理和引发事件。
该方法 OnAfterInstall 允许派生类在不附加委托的情况下处理事件。 这是处理派生类中的事件的首选技术。
继承者说明
在派生类中重写 OnAfterInstall(IDictionary) 时,请务必调用基类的方法,以便已注册的 OnAfterInstall(IDictionary) 委托接收事件。