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