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) ,讓註冊代理接收事件。