diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-25 22:44:23 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-25 22:58:23 -0500 |
commit | 14cdda3c489d6b9801f05939044e67b13939b42d (patch) | |
tree | 7a1f1b6291af5327db56200660c350cb2047a25a /src/engine/engine.cpp | |
parent | bf31c11edf14789d22ce6542549a807d5c5ff086 (diff) | |
download | wix-14cdda3c489d6b9801f05939044e67b13939b42d.tar.gz wix-14cdda3c489d6b9801f05939044e67b13939b42d.tar.bz2 wix-14cdda3c489d6b9801f05939044e67b13939b42d.zip |
Set source of attached containers to WixBundleOriginalSource if set.
Use file size when probing local files.
#5586
Diffstat (limited to '')
-rw-r--r-- | src/engine/engine.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp index bb4061a7..e2728d7f 100644 --- a/src/engine/engine.cpp +++ b/src/engine/engine.cpp | |||
@@ -523,7 +523,8 @@ static HRESULT RunNormal( | |||
523 | ) | 523 | ) |
524 | { | 524 | { |
525 | HRESULT hr = S_OK; | 525 | HRESULT hr = S_OK; |
526 | HANDLE hPipesCreatedEvent = NULL; | 526 | LPWSTR sczOriginalSource = NULL; |
527 | LPWSTR sczCopiedOriginalSource = NULL; | ||
527 | BOOL fContinueExecution = TRUE; | 528 | BOOL fContinueExecution = TRUE; |
528 | BOOL fReloadApp = FALSE; | 529 | BOOL fReloadApp = FALSE; |
529 | BOOL fSkipCleanup = FALSE; | 530 | BOOL fSkipCleanup = FALSE; |
@@ -558,6 +559,27 @@ static HRESULT RunNormal( | |||
558 | hr = CoreQueryRegistration(pEngineState); | 559 | hr = CoreQueryRegistration(pEngineState); |
559 | ExitOnFailure(hr, "Failed to query registration."); | 560 | ExitOnFailure(hr, "Failed to query registration."); |
560 | 561 | ||
562 | // Best effort to set the source of attached containers to BURN_BUNDLE_ORIGINAL_SOURCE. | ||
563 | hr = VariableGetString(&pEngineState->variables, BURN_BUNDLE_ORIGINAL_SOURCE, &sczOriginalSource); | ||
564 | if (SUCCEEDED(hr)) | ||
565 | { | ||
566 | for (DWORD i = 0; i < pEngineState->containers.cContainers; ++i) | ||
567 | { | ||
568 | BURN_CONTAINER* pContainer = pEngineState->containers.rgContainers + i; | ||
569 | if (pContainer->fAttached) | ||
570 | { | ||
571 | hr = StrAllocString(&sczCopiedOriginalSource, sczOriginalSource, 0); | ||
572 | if (SUCCEEDED(hr)) | ||
573 | { | ||
574 | ReleaseNullStr(pContainer->sczSourcePath); | ||
575 | pContainer->sczSourcePath = sczCopiedOriginalSource; | ||
576 | sczCopiedOriginalSource = NULL; | ||
577 | } | ||
578 | } | ||
579 | } | ||
580 | } | ||
581 | hr = S_OK; | ||
582 | |||
561 | // Set some built-in variables before loading the BA. | 583 | // Set some built-in variables before loading the BA. |
562 | hr = PlanSetVariables(pEngineState->command.action, &pEngineState->variables); | 584 | hr = PlanSetVariables(pEngineState->command.action, &pEngineState->variables); |
563 | ExitOnFailure(hr, "Failed to set action variables."); | 585 | ExitOnFailure(hr, "Failed to set action variables."); |
@@ -613,7 +635,8 @@ LExit: | |||
613 | ::PostMessageW(pEngineState->command.hwndSplashScreen, WM_CLOSE, 0, 0); | 635 | ::PostMessageW(pEngineState->command.hwndSplashScreen, WM_CLOSE, 0, 0); |
614 | } | 636 | } |
615 | 637 | ||
616 | ReleaseHandle(hPipesCreatedEvent); | 638 | ReleaseStr(sczOriginalSource); |
639 | ReleaseStr(sczCopiedOriginalSource); | ||
617 | 640 | ||
618 | return hr; | 641 | return hr; |
619 | } | 642 | } |