aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/logging.cpp
diff options
context:
space:
mode:
authorRob Mensching <rob@firegiant.com>2026-01-30 15:18:43 -0800
committerRob Mensching <rob@firegiant.com>2026-01-30 18:38:41 -0800
commit7c3c2cad3c5e95fac151debc89c2f5629b4c6b21 (patch)
tree6d43cdcef8d50a2c524b26681418cee425a39651 /src/burn/engine/logging.cpp
parenta16948df3c51f872e750798a967505a93b8439d5 (diff)
downloadwix-7c3c2cad3c5e95fac151debc89c2f5629b4c6b21.tar.gz
wix-7c3c2cad3c5e95fac151debc89c2f5629b4c6b21.tar.bz2
wix-7c3c2cad3c5e95fac151debc89c2f5629b4c6b21.zip
Many small code quality fixes
Diffstat (limited to 'src/burn/engine/logging.cpp')
-rw-r--r--src/burn/engine/logging.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp
index 51b546ad..52123499 100644
--- a/src/burn/engine/logging.cpp
+++ b/src/burn/engine/logging.cpp
@@ -322,15 +322,17 @@ extern "C" HRESULT LoggingSetPackageVariable(
322 ExitFunction(); 322 ExitFunction();
323 } 323 }
324 324
325 // For burn packages we'll add logging even it it wasn't explictly specified 325 // For burn packages we'll add logging even it it wasn't explictly specified.
326 if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)) 326 if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol))
327 { 327 {
328 if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable)) 328 if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable))
329 { 329 {
330 // Best effort, no need to fail if we can't set the logging path.
330 StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); 331 StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId);
331 } 332 }
332 else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable)) 333 else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable))
333 { 334 {
335 // Best effort, no need to fail if we can't set the logging path.
334 StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); 336 StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId);
335 } 337 }
336 } 338 }
@@ -1052,7 +1054,8 @@ static HRESULT GetNonSessionSpecificTempFolder(
1052 hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); 1054 hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId));
1053 ExitOnFailure(hr, "Failed to get length of session id string."); 1055 ExitOnFailure(hr, "Failed to get length of session id string.");
1054 1056
1055 if (CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE)) 1057 if (cchTempFolder >= cchSessionId &&
1058 CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE))
1056 { 1059 {
1057 cchTempFolder -= cchSessionId; 1060 cchTempFolder -= cchSessionId;
1058 } 1061 }