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
C++UINT WINAPI MsiEndTransaction(
__in DWORD dwTransactionState
);
Parameters
- dwTransactionState [in]
-
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 |
---|---|
|
A transaction can be ended only by the current owner. |
|
An installation belonging to the transaction could not be completed. |
|
An installation belonging to the transaction is still in progress. |
|
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
Version | Windows Installer 5.0 on 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. |
---|---|
Header | Msi.h |
Library | Msi.lib |
DLL | Msi.dll |
See Also
Build date: 8/13/2009
© 2009 Microsoft Corporation. All rights reserved.