Skip to content

Commit

Permalink
Fix package reordering: Only cache actions are reordered, rather than…
Browse files Browse the repository at this point in the history
… the packages
  • Loading branch information
nirbar committed Dec 4, 2024
1 parent 56aea60 commit b5e9edf
Show file tree
Hide file tree
Showing 10 changed files with 420 additions and 113 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ This repository contains the PanelSwWix4: A custom WiX Toolset codebase
- Support sending custom messages on embedded pipe
- Best effort to log premature termination of companion process
- Monitor UX folder and re-extract any UX payloads that were deleted for any reason
- Reorder cache actions: moves non-executing package caching to the end of the plan. This optimizes run time as packages that are cached but not executed will not stand in the way of executing packages.
7 changes: 5 additions & 2 deletions src/burn/engine/apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,10 @@ extern "C" HRESULT ApplyCache(
}
break;

case BURN_CACHE_ACTION_TYPE_DELAYABLE_START:
case BURN_CACHE_ACTION_TYPE_DELAYABLE_END:
break;

default:
AssertSz(FALSE, "Unknown cache action.");
break;
Expand Down Expand Up @@ -2407,7 +2411,6 @@ static void DoRollbackCache(
__in DWORD dwCheckpoint
)
{
HRESULT hr = S_OK;
BURN_PACKAGE* pPackage = NULL;
DWORD dwLastCheckpoint = 0;

Expand All @@ -2432,7 +2435,7 @@ static void DoRollbackCache(
{
if (dwLastCheckpoint <= dwCheckpoint) // only rollback when it was attempted to be cached.
{
hr = CleanPackage(pPlan->pCache, hPipe, pPackage);
CleanPackage(pPlan->pCache, hPipe, pPackage);
}
}
else if (pPackage->fCanAffectRegistration)
Expand Down
2 changes: 1 addition & 1 deletion src/burn/engine/engine.mc
Original file line number Diff line number Diff line change
Expand Up @@ -1321,5 +1321,5 @@ MessageId=707
Severity=Success
SymbolicName=MSG_REORDERING_PACKAGE
Language=English
Moving packages '%1!ls!' to the end of the queue since it is not planned to execute.
Moving packages '%1!ls!' caching to the end of the queue since it is not planned to execute.
.
2 changes: 0 additions & 2 deletions src/burn/engine/package.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ extern "C" HRESULT PackagesParseFromXml(
{
BURN_PACKAGE* pPackage = &pPackages->rgPackages[i];

pPackage->dwPackageIndex = i;

hr = XmlNextElement(pixnNodes, &pixnNode, &bstrNodeName);
ExitOnFailure(hr, "Failed to get next node.");

Expand Down
2 changes: 0 additions & 2 deletions src/burn/engine/package.h
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,6 @@ typedef struct _BURN_PACKAGE
DWORD64 qwInstallSize;
DWORD64 qwSize;

DWORD dwPackageIndex;

BURN_ROLLBACK_BOUNDARY* pRollbackBoundaryForward; // used during install and repair.
BURN_ROLLBACK_BOUNDARY* pRollbackBoundaryBackward; // used during uninstall.

Expand Down
Loading

0 comments on commit b5e9edf

Please sign in to comment.