Transaction Class
[MSI 4.5] Handle to a multi-session install transaction.
Methods
Section titled “Methods”| Method | Description |
|---|---|
| Commit() | Ends the install transaction and commits all changes to the system belonging to the transaction. |
| FromHandle(handle, ownsHandle) | Creates a new Transaction object from an integer handle. |
| Join(attributes) | Makes the current process the owner of the multi-package installation transaction. |
| Rollback() | Ends the install transaction and undoes changes to the system belonging to the transaction. |
Properties
Section titled “Properties”| Property | Description |
|---|---|
| Name | Gets the name of the transaction. |
Events
Section titled “Events”| Event | Description |
|---|---|
| OwnerChanged | Notifies listeners when the process that owns the transaction changed. |
Remarks
Section titled “Remarks”Win32 MSI APIs: MsiBeginTransaction MsiJoinTransaction MsiEndTransaction
WixToolset.Dtf.WindowsInstaller.dll version 5.0.0+41e11442b2ca93e444b60213b5ae99dcbab787d8
Commit() Method
Section titled “Commit() Method”Ends the install transaction and commits all changes to the system belonging to the transaction.
Declaration
Section titled “Declaration”public void Commit()Remarks
Section titled “Remarks”Runs any Commit Custom Actions and commits to the system any changes to Win32 or common language runtime assemblies. Deletes the rollback script, and after using this option, the transaction’s changes can no longer be undone with a Rollback Installation. This method can only be called by the current owner of the transaction. Win32 MSI API: MsiEndTransaction
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:WixToolset.Dtf.WindowsInstaller.InstallerException | The transaction could not be committed. |
FromHandle(handle, ownsHandle) Method
Section titled “FromHandle(handle, ownsHandle) Method”Creates a new Transaction object from an integer handle.
Declaration
Section titled “Declaration”public static Transaction FromHandle( IntPtr handle, bool ownsHandle)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| handle | IntPtr | Integer transaction handle |
| ownsHandle | bool | true to close the handle when this object is disposed |
Join(attributes) Method
Section titled “Join(attributes) Method”Makes the current process the owner of the multi-package installation transaction.
Declaration
Section titled “Declaration”public void Join( TransactionAttributes attributes)Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| attributes | TransactionAttributes | Select optional behavior when joining the transaction. |
Remarks
Section titled “Remarks”Win32 MSI API: MsiJoinTransaction
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:WixToolset.Dtf.WindowsInstaller.InvalidHandleException | The transaction handle is not valid. |
| T:WixToolset.Dtf.WindowsInstaller.InstallerException | The transaction could not be joined. |
Rollback() Method
Section titled “Rollback() Method”Ends the install transaction and undoes changes to the system belonging to the transaction.
Declaration
Section titled “Declaration”public void Rollback()Remarks
Section titled “Remarks”This method can only be called by the current owner of the transaction. Win32 MSI API: MsiEndTransaction
Exceptions
Section titled “Exceptions”| Exception | Description |
|---|---|
| T:WixToolset.Dtf.WindowsInstaller.InstallerException | The transaction could not be rolled back. |
Name Property
Section titled “Name Property”Gets the name of the transaction.
Declaration
Section titled “Declaration”public string Name { get; set; }OwnerChanged Event
Section titled “OwnerChanged Event”Notifies listeners when the process that owns the transaction changed.
Declaration
Section titled “Declaration”public System.EventHandler<System.EventArgs> OwnerChangedSystem.EventHandler<System.EventArgs>