From dfea4478a4938ce738fd49282350d36c73fb9a35 Mon Sep 17 00:00:00 2001 From: Nir Bar Date: Mon, 5 Jun 2023 13:27:56 +0300 Subject: Fixes wixtoolset/issues#5220: Automatically add logging flag for any burn ExePackage, BundlePackage, and related bundles --- src/burn/engine/pseudobundle.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/burn/engine/pseudobundle.cpp') diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index 8b30ebfc..f0d67068 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp @@ -27,7 +27,7 @@ extern "C" HRESULT PseudoBundleInitializeRelated( ExitOnNull(pPackage->payloads.rgItems, hr, E_OUTOFMEMORY, "Failed to allocate space for burn payload group inside of related bundle struct"); pPackage->payloads.cItems = 1; - pPayload = (BURN_PAYLOAD*)MemAlloc(sizeof(BURN_PAYLOAD), TRUE); + pPayload = (BURN_PAYLOAD*)MemAlloc(sizeof(BURN_PAYLOAD), TRUE); ExitOnNull(pPayload, hr, E_OUTOFMEMORY, "Failed to allocate space for burn payload inside of related bundle struct"); pPackage->payloads.rgItems[0].pPayload = pPayload; pPayload->packaging = BURN_PAYLOAD_PACKAGING_EXTERNAL; @@ -59,6 +59,10 @@ extern "C" HRESULT PseudoBundleInitializeRelated( hr = StrAllocString(&pPackage->sczCacheId, wzId, 0); ExitOnFailure(hr, "Failed to copy cache id for pseudo bundle."); + // Log variables - best effort + StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); + StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); + if (pDependencyProvider) { pPackage->rgDependencyProviders = (BURN_DEPENDENCY_PROVIDER*)MemAlloc(sizeof(BURN_DEPENDENCY_PROVIDER), TRUE); @@ -122,6 +126,10 @@ extern "C" HRESULT PseudoBundleInitializePassthrough( hr = StrAllocString(&pPassthroughPackage->sczCacheId, pPackage->sczCacheId, 0); ExitOnFailure(hr, "Failed to copy cache id for passthrough pseudo bundle."); + // Log variables - best effort + StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); + StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); + hr = CoreCreatePassthroughBundleCommandLine(&sczArguments, pInternalCommand, pCommand); ExitOnFailure(hr, "Failed to create command-line arguments."); @@ -207,6 +215,10 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( hr = StrAllocString(&pPackage->sczCacheId, wzCacheId, 0); ExitOnFailure(hr, "Failed to copy cache id for update bundle."); + // Log variables - best effort + StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); + StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); + hr = StrAllocString(&pPackage->Exe.sczInstallArguments, wzInstallArguments, 0); ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); -- cgit v1.2.3-55-g6feb