Skip to main content

Transaction Class

[MSI 4.5] Handle to a multi-session install transaction.

Methods

MethodDescription
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

PropertyDescription
NameGets the name of the transaction.

Events

EventDescription
OwnerChangedNotifies listeners when the process that owns the transaction changed.

Remarks

Win32 MSI APIs: MsiBeginTransaction MsiJoinTransaction MsiEndTransaction

WixToolset.Dtf.WindowsInstaller.dll version 5.0.2+aa65968c419420d32e3e1b647aea0082f5ca5b78

Commit() Method

Ends the install transaction and commits all changes to the system belonging to the transaction.

Declaration

public void Commit()

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

ExceptionDescription
T:WixToolset.Dtf.WindowsInstaller.InstallerExceptionThe transaction could not be committed.

FromHandle(handle, ownsHandle) Method

Creates a new Transaction object from an integer handle.

Declaration

public static Transaction FromHandle(
IntPtr handle,
bool ownsHandle
)

Parameters

ParameterTypeDescription
handleIntPtrInteger transaction handle
ownsHandlebooltrue to close the handle when this object is disposed

Join(attributes) Method

Makes the current process the owner of the multi-package installation transaction.

Declaration

public void Join(
TransactionAttributes attributes
)

Parameters

ParameterTypeDescription
attributesTransactionAttributesSelect optional behavior when joining the transaction.

Remarks

Win32 MSI API: MsiJoinTransaction

Exceptions

ExceptionDescription
T:WixToolset.Dtf.WindowsInstaller.InvalidHandleExceptionThe transaction handle is not valid.
T:WixToolset.Dtf.WindowsInstaller.InstallerExceptionThe transaction could not be joined.

Rollback() Method

Ends the install transaction and undoes changes to the system belonging to the transaction.

Declaration

public void Rollback()

Remarks

This method can only be called by the current owner of the transaction. Win32 MSI API: MsiEndTransaction

Exceptions

ExceptionDescription
T:WixToolset.Dtf.WindowsInstaller.InstallerExceptionThe transaction could not be rolled back.

Name Property

Gets the name of the transaction.

Declaration

public string Name { get; set; } 

OwnerChanged Event

Notifies listeners when the process that owns the transaction changed.

Declaration

public System.EventHandler<System.EventArgs> OwnerChanged

Value

System.EventHandler<System.EventArgs>