Installer.BeforeInstall 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在安装程序集合中每个安装程序的 Install(IDictionary) 方法运行前发生。
public:
event System::Configuration::Install::InstallEventHandler ^ BeforeInstall;
public event System.Configuration.Install.InstallEventHandler BeforeInstall;
member this.BeforeInstall : System.Configuration.Install.InstallEventHandler
Public Custom Event BeforeInstall As InstallEventHandler
事件类型
示例
以下示例演示 了 事件 BeforeInstall 。 它由 OnBeforeInstall 方法引发。
// MyInstaller is derived from the class 'Installer'.
private:
MyInstaller()
{
BeforeInstall += gcnew InstallEventHandler( this, &MyInstaller::BeforeInstallEventHandler );
}
void BeforeInstallEventHandler( Object^ sender, InstallEventArgs^ e )
{
// Add steps to perform any actions before the install process.
Console::WriteLine( "Code for BeforeInstallEventHandler" );
}
// MyInstaller is derived from the class 'Installer'.
MyInstaller() : base()
{
BeforeInstall += new InstallEventHandler(BeforeInstallEventHandler);
}
private void BeforeInstallEventHandler(object sender, InstallEventArgs e)
{
// Add steps to perform any actions before the install process.
Console.WriteLine("Code for BeforeInstallEventHandler");
}
' MyInstaller is derived from the class 'Installer'.
Sub New()
MyBase.New()
AddHandler BeforeInstall, AddressOf BeforeInstallEventHandler
End Sub
Private Sub BeforeInstallEventHandler(sender As Object, e As InstallEventArgs)
' Add steps to perform any actions before the install process.
Console.WriteLine("Code for BeforeInstallEventHandler")
End Sub