-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use wiutil to start/end msi transactions #29
Conversation
There's way too much going on here for one pull request. Let's start with the first one - using wiutil to start/end msi transactions. Please get rid of everything else. It's up to you whether to keep this one open and force push, or close this and open a new one. You must keep calling the methods in msiengine, make the changes there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to keep track of the handles made things really messy. I really hope we can avoid that.
burn.sln
Outdated
@@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 15.0.26124.0 | |||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "src\engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}" | |||
EndProject | |||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stub", "src\stub\stub.vcxproj", "{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}" | |||
ProjectSection(ProjectDependencies) = postProject | |||
{8119537D-E1D9-6591-D51A-49768A2F9C37} = {8119537D-E1D9-6591-D51A-49768A2F9C37} | |||
EndProjectSection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the root issue (incomplete ProjectReference
) in #37.
@@ -1,7 +1,6 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<configuration> | |||
<packageSources> | |||
<clear /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be reverted.
src/engine/apply.cpp
Outdated
// If inside a MSI transaction, roll it back. | ||
if (pCheckpoint->pActiveRollbackBoundary && pCheckpoint->pActiveRollbackBoundary->fActiveTransaction) | ||
{ | ||
hrRollback = ExecuteMsiRollbackTransaction(pEngineState, pCheckpoint->pActiveRollbackBoundary, &context); | ||
IgnoreRollbackError(hrRollback, "Failed rolling back transaction"); | ||
} | ||
else | ||
{ | ||
hrRollback = DoRollbackActions(pEngineState, &context, pCheckpoint->dwId, pfKeepRegistration, pRestart); | ||
IgnoreRollbackError(hrRollback, "Failed rollback actions"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is wrong. DoRollbackActions
needs to be executed even if there was an active MSI transaction. I have already modified the plan so that it doesn't have rollback actions for the MSI/MSP packages.
@@ -830,6 +835,7 @@ extern "C" HRESULT ApplyExecute( | |||
} | |||
|
|||
// Move forward to next rollback boundary. | |||
hr = S_OK; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to take this change in this pull request, it seems to belong to a completely different bug.
SymbolicName=MSG_UX_DECLINED_MSI_TRANSACTION | ||
Language=English | ||
UX voted against MSI transaction on rollback boundary '%1!ls!' | ||
. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These messages should be removed.
src/engine/variable.cpp
Outdated
@@ -157,10 +157,12 @@ static HRESULT InitializeVariableNumeric( | |||
__in DWORD_PTR dwpData, | |||
__inout BURN_VARIANT* pValue | |||
); | |||
#if !defined(_WIN64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes in this file should be reverted.
@@ -641,6 +641,9 @@ namespace Bootstrapper | |||
::InitializeCriticalSection(&pEngineState->csActive); | |||
::InitializeCriticalSection(&pEngineState->userExperience.csEngineActive); | |||
|
|||
hr = WiuInitialize(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should no longer be necessary when the call to WiuIsMsiTransactionSupported
is removed.
src/engine/msiengine.cpp
Outdated
uResult = ::MsiBeginTransaction(wzName, 0, &hTransactionHandle, &hChangeOfOwnerEvent); | ||
|
||
if (ERROR_ROLLBACK_DISABLED == uResult) | ||
if (E_ROLLBACK_DISABLED == hr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I don't see us defining a new HRESULT value from a Win32 error anywhere else in Burn. Since it's used only once, I would rather do HRESULT_FROM_WIN32(ERROR_ROLLBACK_DISABLED)
inline.
I've been thinking about this, and you might as well include the real logging logic in this pull request as well. There needs to be Lines 980 to 981 in 5bab3f6
You would have to pass Lines 2322 to 2323 in 5bab3f6
Lines 1249 to 1255 in 5bab3f6
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to make any progress? I would like to start getting these MSI transaction changes in.
burn.sln
Outdated
@@ -6,6 +6,9 @@ MinimumVisualStudioVersion = 15.0.26124.0 | |||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "engine", "src\engine\engine.vcxproj", "{8119537D-E1D9-6591-D51A-49768A2F9C37}" | |||
EndProject | |||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stub", "src\stub\stub.vcxproj", "{C38373AA-882F-4F55-B03F-2AAB4BFBE3F1}" | |||
ProjectSection(ProjectDependencies) = postProject | |||
{8119537D-E1D9-6591-D51A-49768A2F9C37} = {8119537D-E1D9-6591-D51A-49768A2F9C37} | |||
EndProjectSection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed the root issue (incomplete ProjectReference
) in #37.
) | ||
{ | ||
HRESULT hr = S_OK; | ||
BOOL fBeginCalled = FALSE; | ||
BOOL fCommitCalled = FALSE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was shorthand for "fOnCommitMsiTransactionBeginCalled". There are many places where we're using fBeginCalled
to track whether the BA *Begin method was called. If you find this confusing, then I would prefer fCommitBeginCalled
.
src/engine/plan.cpp
Outdated
@@ -1825,6 +1825,13 @@ extern "C" HRESULT PlanRollbackBoundaryBegin( | |||
AssertSz(!pPlan->pActiveRollbackBoundary, "PlanRollbackBoundaryBegin called without completing previous RollbackBoundary"); | |||
pPlan->pActiveRollbackBoundary = pRollbackBoundary; | |||
|
|||
// Best effort to support MSI transactions | |||
if (pRollbackBoundary->fTransaction && !WiuIsMsiTransactionSupported()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was done in #37.
I have some clients nearing product release dates, so it's quite busy currently. |
@nirbar Ping. |
Add logging for transactions Let BA vote whether or not to use the transaction Warn if transactions aren't suported on the target machine
Thanks. I took the changes for using wiutil and closing the handles immediately and submitted it here: #47. I look forward to the next pull request with the logging enhancements or the BA involvement. |
Add logging for transactions
Let BA vote whether or not to use the transaction
Warn if transactions aren't suported on the target machine
See wixtoolset/issues#5386