MsiEndTransaction function

The MsiEndTransaction function can commit or roll back all the installations belonging to the transaction opened by the MsiBeginTransaction function. This function should be called by the current owner of the transaction.

Windows Installer 4.0 and earlier:  Not supported. This function is available beginning with Windows Installer 4.5.

Syntax

UINT MsiEndTransaction(
  DWORD dwTransactionState
);

Parameters

dwTransactionState

The value of this parameter determines whether the installer commits or rolls back all the installations belonging to the transaction. The value can be one of the following.

Value Meaning
MSITRANSACTIONSTATE_ROLLBACK
Performs a Rollback Installation to undo changes to the system belonging to the transaction opened by the MsiBeginTransaction function.
MSITRANSACTIONSTATE_COMMIT
Commits all changes to the system belonging to the transaction. 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.

Return Value

The MsiEndTransaction function returns the following values.

Value Meaning
ERROR_ACCESS_DENIED
A transaction can be ended only by the current owner.
ERROR_INSTALL_FAILURE
An installation belonging to the transaction could not be completed.
ERROR_INSTALL_ALREADY_RUNNING
An installation belonging to the transaction is still in progress.
ERROR_ROLLBACK_DISABLED
An installation belonging to the transaction did not complete. During the installation, the DisableRollback action disabled rollback installations of the package. The installer rolls back the installation up to the point where rollback was disabled, and the function returns this error.

Requirements

   
Minimum supported client Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.5 on Windows Vista, Windows XP, Windows Server 2003, and Windows Server 2008. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
Target Platform Windows
Header msi.h
Library Msi.lib
DLL Msi.dll

See Also

Multiple Package Installations