Click to Rate and Give Feedback
MSDN
MSDN Library
Windows Installer
Installer Functions
 MsiEndTransaction Function
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 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

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

Version Requires Windows Installer 4.5 or later on Windows Vista, Windows XP, Windows Server 2003, and Windows Server 2008.
Header

Declared in Msi.h.

Library

Use Msi.lib.

DLL

Requires Msi.dll.

See Also

Multiple Package Installations


Build date: 6/5/2008

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Hex Values for Win32 error codes Published as part of Open Protocol Specifications      Robert Flaming - MSFT   |   Edit   |  

As a part of the Open Protocol Specifications, the hex values for Win32 error codes can now be found at http://msdn2.microsoft.com/en-us/library/cc231199.aspx.

Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker