Share via


EventLogInstaller.Uninstall(IDictionary) 方法

定義

從登錄移除事件記錄檔資訊,以移除安裝。

public:
 override void Uninstall(System::Collections::IDictionary ^ savedState);
public override void Uninstall (System.Collections.IDictionary savedState);
override this.Uninstall : System.Collections.IDictionary -> unit
Public Overrides Sub Uninstall (savedState As IDictionary)

參數

savedState
IDictionary

IDictionary,包含電腦的安裝前狀態。

備註

UninstallAction如果屬性值為 RemoveUninstall則方法會刪除安裝程式建立的來源和相關聯的記錄檔,如果 LogSource 屬性指定了新事件記錄檔和來源的建立。

一般而言,您不會從程式代碼內呼叫 的方法 EventLogInstaller ;它們通常只會由卸載模式中的 Installutil.exe (安裝程式工具) 呼叫。 此工具會自動呼叫 Uninstall 方法,將受安裝影響的系統元件還原到其安裝前狀態。 這包括刪除與要卸載之事件記錄檔相關聯的登錄資訊。

應用程式的卸載例程會使用專案安裝程式的 Installer.Context 屬性,自動維護已卸載之元件的相關信息。 當工具卸載每個 EventLogInstaller時,會持續更新傳遞至 Uninstall 作為 savedState 參數的這個狀態資訊。 通常,您的程式代碼不需要明確地修改此狀態資訊。

適用於

另請參閱