EventLogInstaller.Uninstall(IDictionary) 方法


從登錄移除事件記錄檔資訊,以移除安裝。Removes an installation by removing event log information from the registry.

 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)



IDictionary,包含電腦在安裝前的狀態。An IDictionary that contains the pre-installation state of the computer.


Log Remove Uninstall如果屬性值為, 則方法會刪除當和Source屬性指定建立新的事件記錄檔和來源時, 安裝程式所建立的來源和相關聯的記錄檔。 UninstallActionIf the UninstallAction property value is Remove, the Uninstall method deletes the source and the associated log that the installer created if the Log and Source properties specified the creation of a new event log and source.

一般來說, 您不會從程式碼中呼叫EventLogInstaller的方法, 它們通常只會由卸載模式中的installutil.exe (安裝程式工具)所呼叫。Typically, you do not call the methods of the EventLogInstaller from within your code; they are generally called only by the Installutil.exe (Installer Tool) in uninstall mode. 此工具會自動呼叫Uninstall方法, 以將安裝所影響的系統元件還原至其安裝前狀態。The tool automatically calls the Uninstall method to restore the parts of the system that were affected by the installation to their pre-installation states. 這包括刪除與正在卸載的事件記錄檔相關聯的登錄資訊。This includes deleting registry information that is associated with the event log being uninstalled.

應用程式的卸載常式會使用專案安裝程式Installer.Context的屬性, 自動維護已卸載之元件的相關資訊。An application's uninstall routine uses the project installer's Installer.Context property to automatically maintain information about the components that have already been uninstalled. 此狀態資訊 (當做Uninstall savedState參數傳遞至) 會在工具每次EventLogInstaller卸載時持續更新。This state information, which is passed to Uninstall as the savedState parameter, is continuously updated as the tool uninstalls each EventLogInstaller. 通常, 您的程式碼不需要明確地修改此狀態資訊。Usually, it is not necessary for your code to explicitly modify this state information.