Skip to content

Commit

Permalink
Perform all layout operations in the BA process.
Browse files Browse the repository at this point in the history
  • Loading branch information
rseanhall committed Apr 16, 2021
1 parent a2f3914 commit b76e6da
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 217 deletions.
27 changes: 10 additions & 17 deletions src/engine/apply.cpp
Expand Up @@ -1076,13 +1076,13 @@ static HRESULT ApplyCacheVerifyContainerOrPayload(
hr = UserExperienceOnCacheContainerOrPayloadVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId);
ExitOnRootFailure(hr, "BA aborted cache container or payload verify begin.");

if (INVALID_HANDLE_VALUE != pContext->hPipe)
if (pContainer)
{
hr = ElevationCacheVerifyContainerOrPayload(pContext->hPipe, pContainer, pPackage, pPayloadGroupItem->pPayload, pContext->wzLayoutDirectory);
hr = CacheVerifyContainer(pContainer, pContext->wzLayoutDirectory);
}
else if (pContainer)
else if (!pContext->wzLayoutDirectory && INVALID_HANDLE_VALUE != pContext->hPipe)
{
hr = CacheVerifyContainer(pContainer, pContext->wzLayoutDirectory);
hr = ElevationCacheVerifyPayload(pContext->hPipe, pPackage, pPayloadGroupItem->pPayload);
}
else
{
Expand Down Expand Up @@ -1312,14 +1312,7 @@ static HRESULT LayoutBundle(
ExitOnRootFailure(hr, "BA aborted cache verify begin.");
}

if (INVALID_HANDLE_VALUE != pContext->hPipe)
{
hr = ElevationLayoutBundle(pContext->hPipe, pContext->wzLayoutDirectory, wzUnverifiedPath);
}
else
{
hr = CacheLayoutBundle(wzExecutableName, pContext->wzLayoutDirectory, wzUnverifiedPath);
}
hr = CacheLayoutBundle(wzExecutableName, pContext->wzLayoutDirectory, wzUnverifiedPath);

if (SUCCEEDED(hr))
{
Expand Down Expand Up @@ -1561,11 +1554,7 @@ static HRESULT LayoutOrCacheContainerOrPayload(
hr = UserExperienceOnCacheVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId);
ExitOnRootFailure(hr, "BA aborted cache verify begin.");

if (INVALID_HANDLE_VALUE != pContext->hPipe) // pass the decision off to the elevated process.
{
hr = ElevationCacheOrLayoutContainerOrPayload(pContext->hPipe, pContainer, pPackage, pPayload, pContext->wzLayoutDirectory, wzUnverifiedPath, fMove);
}
else if (pContext->wzLayoutDirectory) // layout the container or payload.
if (pContext->wzLayoutDirectory) // layout the container or payload.
{
if (pContainer)
{
Expand All @@ -1576,6 +1565,10 @@ static HRESULT LayoutOrCacheContainerOrPayload(
hr = CacheLayoutPayload(pPayload, pContext->wzLayoutDirectory, wzUnverifiedPath, fMove);
}
}
else if (INVALID_HANDLE_VALUE != pContext->hPipe) // pass the decision off to the elevated process.
{
hr = ElevationCacheCompletePayload(pContext->hPipe, pPackage, pPayload, wzUnverifiedPath, fMove);
}
else // complete the payload.
{
hr = CacheCompletePayload(pPackage->fPerMachine, pPayload, pPackage->sczCacheId, wzUnverifiedPath, fMove);
Expand Down

0 comments on commit b76e6da

Please sign in to comment.