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

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.

ValueMeaning
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.

ValueMeaning
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

VersionWindows 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.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll

See Also

Multiple Package Installations

Build date: 10/29/2009

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   |   Show History

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
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker