AssemblyInstaller.Rollback(IDictionary) 方法

定義

將電腦還原至安裝之前的狀態。Restores the computer to the state it was in before the installation.

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 pre-installation state of the computer.

例外狀況

savedState 參數為 nullThe savedState parameter is null.

-或--or- IDictionary 的儲存狀態可能已經損毀。The saved-state IDictionary might have been corrupted.

-或--or- 無法找到檔案。A file could not be found.

在集合中有一個安裝程式的 BeforeRollback 事件處理常式發生例外狀況。An exception occurred in the BeforeRollback event handler of one of the installers in the collection.

-或--or- 在集合中有一個安裝程式的 AfterRollback 事件處理常式發生例外狀況。An exception occurred in the AfterRollback event handler of one of the installers in the collection.

-或--or- 在安裝的 Rollback(IDictionary) 階段時發生例外狀況。An exception occurred during the Rollback(IDictionary) phase of the installation. 例外狀況會被忽略,並且繼續執行復原。The exception is ignored and the rollback continues. 不過,復原完成之後,電腦可能無法完全還原至其初始狀態。However, the computer might not be fully reverted to its initial state after the rollback completes.

-或--or- 在其中一個組件中無法找到安裝程式型別。Installer types were not found in one of the assemblies.

-或--or- 無法建立其中一個安裝程式型別的執行個體。An instance of one of the installer types could not be created.

在安裝的 Rollback(IDictionary) 階段時發生例外狀況。An exception occurred during the Rollback(IDictionary) phase of the installation. 例外狀況會被忽略,並且繼續執行復原。The exception is ignored and the rollback continues. 不過,復原完成之後,電腦可能無法完全還原至其初始狀態。However, the computer might not be fully reverted to its initial state after the rollback completes.

範例

在下列範例中, Rollback會呼叫方法來復原指定元件上的安裝進程。In the following sample, the Rollback method is called to undo the install process on the specified assembly.

// 'Rollback' the installation process.
myAssemblyInstaller->Rollback( mySavedState );

// 'Rollback' the installation process.
myAssemblyInstaller.Rollback( mySavedState );
' 'Rollback' the installation process.
myAssemblyInstaller.Rollback(mySavedState)

備註

復原會將電腦還原到安裝之前的狀態。A rollback restores the computer to the state it was in before the installation occurred. 如果這個Rollback 實例或安裝程式集合中任何安裝程式的方法都無法正確執行,則Installer Install會呼叫方法。The Rollback method is called if the Install method of this Installer instance or of any installer in the installer collection fails to run correctly. 在集合中呼叫Rollback安裝程式的方法所產生的任何例外狀況都會被忽略,而其他安裝程式的回復則會繼續進行。Any exceptions generated by calling the Rollback method of an installer in the collection are ignored, and the rollback of the other installers continues.

適用於