diff options
author | Nir Bar <nir.bar@panel-sw.co.il> | 2021-08-12 14:16:01 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-08-12 14:50:55 -0500 |
commit | bb18c9c4f0e6da640775b85ebda68b31f2b391ed (patch) | |
tree | 5ce6107321293f7af7a0504588e3d0c6642472ff /src/burn/engine/logging.cpp | |
parent | 0042e3d4554a0d92e1da6141854b0f1aafa07d5b (diff) | |
download | wix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.tar.gz wix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.tar.bz2 wix-bb18c9c4f0e6da640775b85ebda68b31f2b391ed.zip |
Set the log file path for MSI transactions.
Diffstat (limited to 'src/burn/engine/logging.cpp')
-rw-r--r-- | src/burn/engine/logging.cpp | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 9aaf60ed..33295acd 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
@@ -242,11 +242,6 @@ extern "C" HRESULT LoggingSetPackageVariable( | |||
242 | // Make sure that no package log files are created when logging has been disabled via Log element. | 242 | // Make sure that no package log files are created when logging has been disabled via Log element. |
243 | if (BURN_LOGGING_STATE_DISABLED == pLog->state) | 243 | if (BURN_LOGGING_STATE_DISABLED == pLog->state) |
244 | { | 244 | { |
245 | if (psczLogPath) | ||
246 | { | ||
247 | *psczLogPath = NULL; | ||
248 | } | ||
249 | |||
250 | ExitFunction(); | 245 | ExitFunction(); |
251 | } | 246 | } |
252 | 247 | ||
@@ -272,6 +267,36 @@ LExit: | |||
272 | return hr; | 267 | return hr; |
273 | } | 268 | } |
274 | 269 | ||
270 | extern "C" HRESULT LoggingSetTransactionVariable( | ||
271 | __in BURN_ROLLBACK_BOUNDARY* pRollbackBoundary, | ||
272 | __in_z_opt LPCWSTR wzSuffix, | ||
273 | __in BURN_LOGGING* pLog, | ||
274 | __in BURN_VARIABLES* pVariables | ||
275 | ) | ||
276 | { | ||
277 | HRESULT hr = S_OK; | ||
278 | |||
279 | // Make sure that no log files are created when logging has been disabled via Log element. | ||
280 | if (BURN_LOGGING_STATE_DISABLED == pLog->state) | ||
281 | { | ||
282 | ExitFunction(); | ||
283 | } | ||
284 | |||
285 | if (pRollbackBoundary && pRollbackBoundary->sczLogPathVariable && *pRollbackBoundary->sczLogPathVariable) | ||
286 | { | ||
287 | hr = StrAllocFormatted(&pRollbackBoundary->sczLogPath, L"%ls%hs%ls_%03u_%ls.%ls", pLog->sczPrefix, wzSuffix && *wzSuffix ? "_" : "", wzSuffix && *wzSuffix ? wzSuffix : L"", vdwPackageSequence, pRollbackBoundary->sczId, pLog->sczExtension); | ||
288 | ExitOnFailure(hr, "Failed to allocate path for transaction log."); | ||
289 | |||
290 | hr = VariableSetString(pVariables, pRollbackBoundary->sczLogPathVariable, pRollbackBoundary->sczLogPath, FALSE, FALSE); | ||
291 | ExitOnFailure(hr, "Failed to set log path into variable."); | ||
292 | } | ||
293 | |||
294 | LExit: | ||
295 | ++vdwPackageSequence; | ||
296 | |||
297 | return hr; | ||
298 | } | ||
299 | |||
275 | extern "C" LPCSTR LoggingBurnActionToString( | 300 | extern "C" LPCSTR LoggingBurnActionToString( |
276 | __in BOOTSTRAPPER_ACTION action | 301 | __in BOOTSTRAPPER_ACTION action |
277 | ) | 302 | ) |