ServiceProcessInstaller.Rollback(IDictionary) 方法

定义

回滚由安装过程写到注册表的服务应用程序信息。Rolls back service application information written to the registry by the installation procedure. 该方法旨在由自动处理适当方法的安装工具使用。This method is meant to be used by installation tools, which process the appropriate methods automatically.

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

参数

savedState
IDictionary

IDictionary,包含与安装关联的上下文信息。An IDictionary that contains the context information associated with the installation.

例外

savedStatenullThe savedState is null.

- 或 --or- savedState 已损坏或不存在。The savedState is corrupted or non-existent.

注解

通常情况下,你不会在代码中调用方法, ServiceProcessInstaller 通常仅由安装实用工具调用它们。Normally, you do not call the methods on ServiceProcessInstaller within your code; they are generally called only by the install utility. 安装实用程序会在 ServiceProcessInstaller.Install 安装过程中自动调用此方法。The install utility automatically calls the ServiceProcessInstaller.Install method during the installation process. 如果需要,它会 Rollback 在生成异常的对象上调用,从而支持故障。It backs out failures, if necessary, by calling Rollback on the object that generated the exception.

应用程序的安装例程使用项目安装程序的,自动维护有关已安装组件的信息 Installer.ContextAn application's install routine maintains information automatically about the components already installed, using the project installer's Installer.Context. 作为参数传递到的此状态信息 Rollback savedState 会不断更新为 ServiceProcessInstaller 实例,并且每个 ServiceInstaller 实例由实用工具安装。This state information, passed into Rollback as the savedState parameter, is continuously updated as the ServiceProcessInstaller instance and each ServiceInstaller instance is installed by the utility. 通常不需要让代码显式修改此状态信息。It is usually unnecessary for your code to modify this state information explicitly.

Rollback向调用方法传递基类方法或 BeforeInstall / AfterInstall 事件处理程序引发的任何异常。Rollback passes to the calling method any exceptions thrown by base class methods or BeforeInstall / AfterInstall event handlers.

适用于

另请参阅