diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-11-15 19:54:20 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-11-17 19:06:00 -0600 |
| commit | 0d873d28c2dd18444afa08b748e91f495ed1cf5c (patch) | |
| tree | c82e70b9ac047b316f976e6078bf19ff19cc7d95 /src/engine | |
| parent | d6aceb1277606fe1f1688d40ee0895d0b89c6705 (diff) | |
| download | wix-0d873d28c2dd18444afa08b748e91f495ed1cf5c.tar.gz wix-0d873d28c2dd18444afa08b748e91f495ed1cf5c.tar.bz2 wix-0d873d28c2dd18444afa08b748e91f495ed1cf5c.zip | |
Add plan tests.
Diffstat (limited to 'src/engine')
| -rw-r--r-- | src/engine/container.cpp | 36 | ||||
| -rw-r--r-- | src/engine/container.h | 5 | ||||
| -rw-r--r-- | src/engine/core.cpp | 4 | ||||
| -rw-r--r-- | src/engine/logging.cpp | 21 | ||||
| -rw-r--r-- | src/engine/logging.h | 4 | ||||
| -rw-r--r-- | src/engine/manifest.cpp | 49 | ||||
| -rw-r--r-- | src/engine/manifest.h | 5 | ||||
| -rw-r--r-- | src/engine/msiengine.cpp | 5 | ||||
| -rw-r--r-- | src/engine/msiengine.h | 6 | ||||
| -rw-r--r-- | src/engine/plan.cpp | 34 | ||||
| -rw-r--r-- | src/engine/plan.h | 3 |
11 files changed, 138 insertions, 34 deletions
diff --git a/src/engine/container.cpp b/src/engine/container.cpp index ada9025b..55a16afb 100644 --- a/src/engine/container.cpp +++ b/src/engine/container.cpp | |||
| @@ -17,7 +17,6 @@ static HRESULT GetAttachedContainerInfo( | |||
| 17 | // function definitions | 17 | // function definitions |
| 18 | 18 | ||
| 19 | extern "C" HRESULT ContainersParseFromXml( | 19 | extern "C" HRESULT ContainersParseFromXml( |
| 20 | __in BURN_SECTION* pSection, | ||
| 21 | __in BURN_CONTAINERS* pContainers, | 20 | __in BURN_CONTAINERS* pContainers, |
| 22 | __in IXMLDOMNode* pixnBundle | 21 | __in IXMLDOMNode* pixnBundle |
| 23 | ) | 22 | ) |
| @@ -128,14 +127,6 @@ extern "C" HRESULT ContainersParseFromXml( | |||
| 128 | ExitOnFailure(hr, "Failed to get @Hash."); | 127 | ExitOnFailure(hr, "Failed to get @Hash."); |
| 129 | } | 128 | } |
| 130 | 129 | ||
| 131 | // If the container is attached, make sure the information in the section matches what the | ||
| 132 | // manifest contained and get the offset to the container. | ||
| 133 | if (pContainer->fAttached) | ||
| 134 | { | ||
| 135 | hr = SectionGetAttachedContainerInfo(pSection, pContainer->dwAttachedIndex, pContainer->type, &pContainer->qwAttachedOffset, &pContainer->qwFileSize, &pContainer->fActuallyAttached); | ||
| 136 | ExitOnFailure(hr, "Failed to get attached container information."); | ||
| 137 | } | ||
| 138 | |||
| 139 | // prepare next iteration | 130 | // prepare next iteration |
| 140 | ReleaseNullObject(pixnNode); | 131 | ReleaseNullObject(pixnNode); |
| 141 | } | 132 | } |
| @@ -150,6 +141,33 @@ LExit: | |||
| 150 | return hr; | 141 | return hr; |
| 151 | } | 142 | } |
| 152 | 143 | ||
| 144 | extern "C" HRESULT ContainersInitialize( | ||
| 145 | __in BURN_CONTAINERS* pContainers, | ||
| 146 | __in BURN_SECTION* pSection | ||
| 147 | ) | ||
| 148 | { | ||
| 149 | HRESULT hr = S_OK; | ||
| 150 | |||
| 151 | if (pContainers->rgContainers) | ||
| 152 | { | ||
| 153 | for (DWORD i = 0; i < pContainers->cContainers; ++i) | ||
| 154 | { | ||
| 155 | BURN_CONTAINER* pContainer = &pContainers->rgContainers[i]; | ||
| 156 | |||
| 157 | // If the container is attached, make sure the information in the section matches what the | ||
| 158 | // manifest contained and get the offset to the container. | ||
| 159 | if (pContainer->fAttached) | ||
| 160 | { | ||
| 161 | hr = SectionGetAttachedContainerInfo(pSection, pContainer->dwAttachedIndex, pContainer->type, &pContainer->qwAttachedOffset, &pContainer->qwFileSize, &pContainer->fActuallyAttached); | ||
| 162 | ExitOnFailure(hr, "Failed to get attached container information."); | ||
| 163 | } | ||
| 164 | } | ||
| 165 | } | ||
| 166 | |||
| 167 | LExit: | ||
| 168 | return hr; | ||
| 169 | } | ||
| 170 | |||
| 153 | extern "C" void ContainersUninitialize( | 171 | extern "C" void ContainersUninitialize( |
| 154 | __in BURN_CONTAINERS* pContainers | 172 | __in BURN_CONTAINERS* pContainers |
| 155 | ) | 173 | ) |
diff --git a/src/engine/container.h b/src/engine/container.h index 2ca3d7ad..bbd9fa72 100644 --- a/src/engine/container.h +++ b/src/engine/container.h | |||
| @@ -135,10 +135,13 @@ typedef struct _BURN_CONTAINER_CONTEXT | |||
| 135 | // functions | 135 | // functions |
| 136 | 136 | ||
| 137 | HRESULT ContainersParseFromXml( | 137 | HRESULT ContainersParseFromXml( |
| 138 | __in BURN_SECTION* pSection, | ||
| 139 | __in BURN_CONTAINERS* pContainers, | 138 | __in BURN_CONTAINERS* pContainers, |
| 140 | __in IXMLDOMNode* pixnBundle | 139 | __in IXMLDOMNode* pixnBundle |
| 141 | ); | 140 | ); |
| 141 | HRESULT ContainersInitialize( | ||
| 142 | __in BURN_CONTAINERS* pContainers, | ||
| 143 | __in BURN_SECTION* pSection | ||
| 144 | ); | ||
| 142 | void ContainersUninitialize( | 145 | void ContainersUninitialize( |
| 143 | __in BURN_CONTAINERS* pContainers | 146 | __in BURN_CONTAINERS* pContainers |
| 144 | ); | 147 | ); |
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index c34024fd..aeae6bea 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
| @@ -96,6 +96,9 @@ extern "C" HRESULT CoreInitialize( | |||
| 96 | hr = ManifestLoadXmlFromBuffer(pbBuffer, cbBuffer, pEngineState); | 96 | hr = ManifestLoadXmlFromBuffer(pbBuffer, cbBuffer, pEngineState); |
| 97 | ExitOnFailure(hr, "Failed to load manifest."); | 97 | ExitOnFailure(hr, "Failed to load manifest."); |
| 98 | 98 | ||
| 99 | hr = ContainersInitialize(&pEngineState->containers, &pEngineState->section); | ||
| 100 | ExitOnFailure(hr, "Failed to intialize containers."); | ||
| 101 | |||
| 99 | // Parse command line. | 102 | // Parse command line. |
| 100 | hr = ParseCommandLine(pEngineState->argc, pEngineState->argv, &pEngineState->command, &pEngineState->companionConnection, &pEngineState->embeddedConnection, &pEngineState->variables, &pEngineState->mode, &pEngineState->automaticUpdates, &pEngineState->fDisableSystemRestore, &sczSourceProcessPath, &sczOriginalSource, &pEngineState->fDisableUnelevate, &pEngineState->log.dwAttributes, &pEngineState->log.sczPath, &pEngineState->registration.sczActiveParent, &pEngineState->sczIgnoreDependencies, &pEngineState->registration.sczAncestors, &sczSanitizedCommandLine); | 103 | hr = ParseCommandLine(pEngineState->argc, pEngineState->argv, &pEngineState->command, &pEngineState->companionConnection, &pEngineState->embeddedConnection, &pEngineState->variables, &pEngineState->mode, &pEngineState->automaticUpdates, &pEngineState->fDisableSystemRestore, &sczSourceProcessPath, &sczOriginalSource, &pEngineState->fDisableUnelevate, &pEngineState->log.dwAttributes, &pEngineState->log.sczPath, &pEngineState->registration.sczActiveParent, &pEngineState->sczIgnoreDependencies, &pEngineState->registration.sczAncestors, &sczSanitizedCommandLine); |
| 101 | ExitOnFailure(hr, "Failed to parse command line."); | 104 | ExitOnFailure(hr, "Failed to parse command line."); |
| @@ -411,6 +414,7 @@ extern "C" HRESULT CorePlan( | |||
| 411 | pEngineState->plan.action = action; | 414 | pEngineState->plan.action = action; |
| 412 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; | 415 | pEngineState->plan.wzBundleId = pEngineState->registration.sczId; |
| 413 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; | 416 | pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; |
| 417 | pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback; | ||
| 414 | 418 | ||
| 415 | hr = PlanSetVariables(action, &pEngineState->variables); | 419 | hr = PlanSetVariables(action, &pEngineState->variables); |
| 416 | ExitOnFailure(hr, "Failed to update action."); | 420 | ExitOnFailure(hr, "Failed to update action."); |
diff --git a/src/engine/logging.cpp b/src/engine/logging.cpp index e69303f0..512b562c 100644 --- a/src/engine/logging.cpp +++ b/src/engine/logging.cpp | |||
| @@ -468,6 +468,27 @@ extern "C" LPCSTR LoggingMsiInstallContext( | |||
| 468 | } | 468 | } |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | extern "C" LPCWSTR LoggingBurnMsiPropertyToString( | ||
| 472 | __in BURN_MSI_PROPERTY burnMsiProperty | ||
| 473 | ) | ||
| 474 | { | ||
| 475 | switch (burnMsiProperty) | ||
| 476 | { | ||
| 477 | case BURN_MSI_PROPERTY_INSTALL: | ||
| 478 | return BURNMSIINSTALL_PROPERTY_NAME; | ||
| 479 | case BURN_MSI_PROPERTY_MODIFY: | ||
| 480 | return BURNMSIMODIFY_PROPERTY_NAME; | ||
| 481 | case BURN_MSI_PROPERTY_NONE: | ||
| 482 | return L"(none)"; | ||
| 483 | case BURN_MSI_PROPERTY_REPAIR: | ||
| 484 | return BURNMSIREPAIR_PROPERTY_NAME; | ||
| 485 | case BURN_MSI_PROPERTY_UNINSTALL: | ||
| 486 | return BURNMSIUNINSTALL_PROPERTY_NAME; | ||
| 487 | default: | ||
| 488 | return L"Invalid"; | ||
| 489 | } | ||
| 490 | } | ||
| 491 | |||
| 471 | extern "C" LPCSTR LoggingPerMachineToString( | 492 | extern "C" LPCSTR LoggingPerMachineToString( |
| 472 | __in BOOL fPerMachine | 493 | __in BOOL fPerMachine |
| 473 | ) | 494 | ) |
diff --git a/src/engine/logging.h b/src/engine/logging.h index 22dd54d9..381a295b 100644 --- a/src/engine/logging.h +++ b/src/engine/logging.h | |||
| @@ -101,6 +101,10 @@ LPCSTR LoggingMsiInstallContext( | |||
| 101 | __in MSIINSTALLCONTEXT context | 101 | __in MSIINSTALLCONTEXT context |
| 102 | ); | 102 | ); |
| 103 | 103 | ||
| 104 | LPCWSTR LoggingBurnMsiPropertyToString( | ||
| 105 | __in BURN_MSI_PROPERTY burnMsiProperty | ||
| 106 | ); | ||
| 107 | |||
| 104 | LPCSTR LoggingPerMachineToString( | 108 | LPCSTR LoggingPerMachineToString( |
| 105 | __in BOOL fPerMachine | 109 | __in BOOL fPerMachine |
| 106 | ); | 110 | ); |
diff --git a/src/engine/manifest.cpp b/src/engine/manifest.cpp index 8783b15e..270b6b74 100644 --- a/src/engine/manifest.cpp +++ b/src/engine/manifest.cpp | |||
| @@ -3,8 +3,33 @@ | |||
| 3 | #include "precomp.h" | 3 | #include "precomp.h" |
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | static HRESULT ParseFromXml( | ||
| 7 | __in IXMLDOMDocument* pixdDocument, | ||
| 8 | __in BURN_ENGINE_STATE* pEngineState | ||
| 9 | ); | ||
| 10 | |||
| 6 | // function definitions | 11 | // function definitions |
| 7 | 12 | ||
| 13 | extern "C" HRESULT ManifestLoadXml( | ||
| 14 | __in LPCWSTR wzDocument, | ||
| 15 | __in BURN_ENGINE_STATE* pEngineState | ||
| 16 | ) | ||
| 17 | { | ||
| 18 | HRESULT hr = S_OK; | ||
| 19 | IXMLDOMDocument* pixdDocument = NULL; | ||
| 20 | |||
| 21 | // load xml document | ||
| 22 | hr = XmlLoadDocument(wzDocument, &pixdDocument); | ||
| 23 | ExitOnFailure(hr, "Failed to load manifest as XML document."); | ||
| 24 | |||
| 25 | hr = ParseFromXml(pixdDocument, pEngineState); | ||
| 26 | |||
| 27 | LExit: | ||
| 28 | ReleaseObject(pixdDocument); | ||
| 29 | |||
| 30 | return hr; | ||
| 31 | } | ||
| 32 | |||
| 8 | extern "C" HRESULT ManifestLoadXmlFromBuffer( | 33 | extern "C" HRESULT ManifestLoadXmlFromBuffer( |
| 9 | __in_bcount(cbBuffer) BYTE* pbBuffer, | 34 | __in_bcount(cbBuffer) BYTE* pbBuffer, |
| 10 | __in SIZE_T cbBuffer, | 35 | __in SIZE_T cbBuffer, |
| @@ -13,14 +38,29 @@ extern "C" HRESULT ManifestLoadXmlFromBuffer( | |||
| 13 | { | 38 | { |
| 14 | HRESULT hr = S_OK; | 39 | HRESULT hr = S_OK; |
| 15 | IXMLDOMDocument* pixdDocument = NULL; | 40 | IXMLDOMDocument* pixdDocument = NULL; |
| 16 | IXMLDOMElement* pixeBundle = NULL; | ||
| 17 | IXMLDOMNode* pixnLog = NULL; | ||
| 18 | IXMLDOMNode* pixnChain = NULL; | ||
| 19 | 41 | ||
| 20 | // load xml document | 42 | // load xml document |
| 21 | hr = XmlLoadDocumentFromBuffer(pbBuffer, cbBuffer, &pixdDocument); | 43 | hr = XmlLoadDocumentFromBuffer(pbBuffer, cbBuffer, &pixdDocument); |
| 22 | ExitOnFailure(hr, "Failed to load manifest as XML document."); | 44 | ExitOnFailure(hr, "Failed to load manifest as XML document."); |
| 23 | 45 | ||
| 46 | hr = ParseFromXml(pixdDocument, pEngineState); | ||
| 47 | |||
| 48 | LExit: | ||
| 49 | ReleaseObject(pixdDocument); | ||
| 50 | |||
| 51 | return hr; | ||
| 52 | } | ||
| 53 | |||
| 54 | static HRESULT ParseFromXml( | ||
| 55 | __in IXMLDOMDocument* pixdDocument, | ||
| 56 | __in BURN_ENGINE_STATE* pEngineState | ||
| 57 | ) | ||
| 58 | { | ||
| 59 | HRESULT hr = S_OK; | ||
| 60 | IXMLDOMElement* pixeBundle = NULL; | ||
| 61 | IXMLDOMNode* pixnLog = NULL; | ||
| 62 | IXMLDOMNode* pixnChain = NULL; | ||
| 63 | |||
| 24 | // get bundle element | 64 | // get bundle element |
| 25 | hr = pixdDocument->get_documentElement(&pixeBundle); | 65 | hr = pixdDocument->get_documentElement(&pixeBundle); |
| 26 | ExitOnFailure(hr, "Failed to get bundle element."); | 66 | ExitOnFailure(hr, "Failed to get bundle element."); |
| @@ -105,7 +145,7 @@ extern "C" HRESULT ManifestLoadXmlFromBuffer( | |||
| 105 | ExitOnFailure(hr, "Failed to parse update."); | 145 | ExitOnFailure(hr, "Failed to parse update."); |
| 106 | 146 | ||
| 107 | // parse containers | 147 | // parse containers |
| 108 | hr = ContainersParseFromXml(&pEngineState->section, &pEngineState->containers, pixeBundle); | 148 | hr = ContainersParseFromXml(&pEngineState->containers, pixeBundle); |
| 109 | ExitOnFailure(hr, "Failed to parse containers."); | 149 | ExitOnFailure(hr, "Failed to parse containers."); |
| 110 | 150 | ||
| 111 | // parse payloads | 151 | // parse payloads |
| @@ -124,6 +164,5 @@ LExit: | |||
| 124 | ReleaseObject(pixnChain); | 164 | ReleaseObject(pixnChain); |
| 125 | ReleaseObject(pixnLog); | 165 | ReleaseObject(pixnLog); |
| 126 | ReleaseObject(pixeBundle); | 166 | ReleaseObject(pixeBundle); |
| 127 | ReleaseObject(pixdDocument); | ||
| 128 | return hr; | 167 | return hr; |
| 129 | } | 168 | } |
diff --git a/src/engine/manifest.h b/src/engine/manifest.h index 6e535d60..223181d9 100644 --- a/src/engine/manifest.h +++ b/src/engine/manifest.h | |||
| @@ -11,6 +11,11 @@ extern "C" { | |||
| 11 | 11 | ||
| 12 | // function declarations | 12 | // function declarations |
| 13 | 13 | ||
| 14 | HRESULT ManifestLoadXml( | ||
| 15 | __in LPCWSTR wzDocument, | ||
| 16 | __in BURN_ENGINE_STATE* pEngineState | ||
| 17 | ); | ||
| 18 | |||
| 14 | HRESULT ManifestLoadXmlFromBuffer( | 19 | HRESULT ManifestLoadXmlFromBuffer( |
| 15 | __in_bcount(cbBuffer) BYTE* pbBuffer, | 20 | __in_bcount(cbBuffer) BYTE* pbBuffer, |
| 16 | __in SIZE_T cbBuffer, | 21 | __in SIZE_T cbBuffer, |
diff --git a/src/engine/msiengine.cpp b/src/engine/msiengine.cpp index 066734d0..c20e2ef8 100644 --- a/src/engine/msiengine.cpp +++ b/src/engine/msiengine.cpp | |||
| @@ -4,10 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ||
| 6 | // constants | 6 | // constants |
| 7 | #define BURNMSIINSTALL_PROPERTY_NAME L"BURNMSIINSTALL" | 7 | |
| 8 | #define BURNMSIMODIFY_PROPERTY_NAME L"BURNMSIMODIFY" | ||
| 9 | #define BURNMSIREPAIR_PROPERTY_NAME L"BURNMSIREPAIR" | ||
| 10 | #define BURNMSIUNINSTALL_PROPERTY_NAME L"BURNMSIUNINSTALL" | ||
| 11 | 8 | ||
| 12 | // structs | 9 | // structs |
| 13 | 10 | ||
diff --git a/src/engine/msiengine.h b/src/engine/msiengine.h index 04c375c2..64bddcf0 100644 --- a/src/engine/msiengine.h +++ b/src/engine/msiengine.h | |||
| @@ -1,6 +1,12 @@ | |||
| 1 | #pragma once | 1 | #pragma once |
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 3 | 3 | ||
| 4 | // constants | ||
| 5 | #define BURNMSIINSTALL_PROPERTY_NAME L"BURNMSIINSTALL" | ||
| 6 | #define BURNMSIMODIFY_PROPERTY_NAME L"BURNMSIMODIFY" | ||
| 7 | #define BURNMSIREPAIR_PROPERTY_NAME L"BURNMSIREPAIR" | ||
| 8 | #define BURNMSIUNINSTALL_PROPERTY_NAME L"BURNMSIUNINSTALL" | ||
| 9 | |||
| 4 | 10 | ||
| 5 | #if defined(__cplusplus) | 11 | #if defined(__cplusplus) |
| 6 | extern "C" { | 12 | extern "C" { |
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index 3c0e1c50..e2a3437d 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
| @@ -74,7 +74,9 @@ static BOOL AlreadyPlannedCachePackage( | |||
| 74 | __in_z LPCWSTR wzPackageId, | 74 | __in_z LPCWSTR wzPackageId, |
| 75 | __out HANDLE* phSyncpointEvent | 75 | __out HANDLE* phSyncpointEvent |
| 76 | ); | 76 | ); |
| 77 | static DWORD GetNextCheckpointId(); | 77 | static DWORD GetNextCheckpointId( |
| 78 | __in BURN_PLAN* pPlan | ||
| 79 | ); | ||
| 78 | static HRESULT AppendCacheAction( | 80 | static HRESULT AppendCacheAction( |
| 79 | __in BURN_PLAN* pPlan, | 81 | __in BURN_PLAN* pPlan, |
| 80 | __out BURN_CACHE_ACTION** ppCacheAction | 82 | __out BURN_CACHE_ACTION** ppCacheAction |
| @@ -1621,7 +1623,7 @@ extern "C" HRESULT PlanExecuteCheckpoint( | |||
| 1621 | { | 1623 | { |
| 1622 | HRESULT hr = S_OK; | 1624 | HRESULT hr = S_OK; |
| 1623 | BURN_EXECUTE_ACTION* pAction = NULL; | 1625 | BURN_EXECUTE_ACTION* pAction = NULL; |
| 1624 | DWORD dwCheckpointId = GetNextCheckpointId(); | 1626 | DWORD dwCheckpointId = GetNextCheckpointId(pPlan); |
| 1625 | 1627 | ||
| 1626 | // execute checkpoint | 1628 | // execute checkpoint |
| 1627 | hr = PlanAppendExecuteAction(pPlan, &pAction); | 1629 | hr = PlanAppendExecuteAction(pPlan, &pAction); |
| @@ -1808,7 +1810,7 @@ extern "C" HRESULT PlanRollbackBoundaryComplete( | |||
| 1808 | DWORD dwCheckpointId = 0; | 1810 | DWORD dwCheckpointId = 0; |
| 1809 | 1811 | ||
| 1810 | // Add checkpoints. | 1812 | // Add checkpoints. |
| 1811 | dwCheckpointId = GetNextCheckpointId(); | 1813 | dwCheckpointId = GetNextCheckpointId(pPlan); |
| 1812 | 1814 | ||
| 1813 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); | 1815 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); |
| 1814 | ExitOnFailure(hr, "Failed to append execute action."); | 1816 | ExitOnFailure(hr, "Failed to append execute action."); |
| @@ -2095,7 +2097,7 @@ static HRESULT AddCachePackageHelper( | |||
| 2095 | // Cache checkpoints happen before the package is cached because downloading packages' | 2097 | // Cache checkpoints happen before the package is cached because downloading packages' |
| 2096 | // payloads will not roll themselves back the way installation packages rollback on | 2098 | // payloads will not roll themselves back the way installation packages rollback on |
| 2097 | // failure automatically. | 2099 | // failure automatically. |
| 2098 | dwCheckpoint = GetNextCheckpointId(); | 2100 | dwCheckpoint = GetNextCheckpointId(pPlan); |
| 2099 | 2101 | ||
| 2100 | hr = AppendCacheAction(pPlan, &pCacheAction); | 2102 | hr = AppendCacheAction(pPlan, &pCacheAction); |
| 2101 | ExitOnFailure(hr, "Failed to append package start action."); | 2103 | ExitOnFailure(hr, "Failed to append package start action."); |
| @@ -2234,10 +2236,11 @@ static BOOL AlreadyPlannedCachePackage( | |||
| 2234 | return fPlanned; | 2236 | return fPlanned; |
| 2235 | } | 2237 | } |
| 2236 | 2238 | ||
| 2237 | static DWORD GetNextCheckpointId() | 2239 | static DWORD GetNextCheckpointId( |
| 2240 | __in BURN_PLAN* pPlan | ||
| 2241 | ) | ||
| 2238 | { | 2242 | { |
| 2239 | static DWORD dwCounter = 0; | 2243 | return ++pPlan->dwNextCheckpointId; |
| 2240 | return ++dwCounter; | ||
| 2241 | } | 2244 | } |
| 2242 | 2245 | ||
| 2243 | static HRESULT AppendCacheAction( | 2246 | static HRESULT AppendCacheAction( |
| @@ -3039,11 +3042,11 @@ static void CacheActionLog( | |||
| 3039 | break; | 3042 | break; |
| 3040 | 3043 | ||
| 3041 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: | 3044 | case BURN_CACHE_ACTION_TYPE_SIGNAL_SYNCPOINT: |
| 3042 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: SIGNAL_SYNCPOINT event handle: 0x%x, skip until retried: %hs", wzBase, iAction, pAction->syncpoint.hEvent, LoggingBoolToString(pAction->fSkipUntilRetried)); | 3045 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: SIGNAL_SYNCPOINT event handle: 0x%p, skip until retried: %hs", wzBase, iAction, pAction->syncpoint.hEvent, LoggingBoolToString(pAction->fSkipUntilRetried)); |
| 3043 | break; | 3046 | break; |
| 3044 | 3047 | ||
| 3045 | case BURN_CACHE_ACTION_TYPE_TRANSACTION_BOUNDARY: | 3048 | case BURN_CACHE_ACTION_TYPE_TRANSACTION_BOUNDARY: |
| 3046 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: TRANSACTION_BOUNDARY id: %ls, event handle: 0x%x, vital: %ls, transaction: %ls", wzBase, iAction, pAction->rollbackBoundary.pRollbackBoundary->sczId, pAction->rollbackBoundary.hEvent, pAction->rollbackBoundary.pRollbackBoundary->fVital ? L"yes" : L"no", pAction->rollbackBoundary.pRollbackBoundary->fTransaction ? L"yes" : L"no"); | 3049 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: TRANSACTION_BOUNDARY id: %ls, event handle: 0x%p, vital: %ls, transaction: %ls", wzBase, iAction, pAction->rollbackBoundary.pRollbackBoundary->sczId, pAction->rollbackBoundary.hEvent, pAction->rollbackBoundary.pRollbackBoundary->fVital ? L"yes" : L"no", pAction->rollbackBoundary.pRollbackBoundary->fTransaction ? L"yes" : L"no"); |
| 3047 | break; | 3050 | break; |
| 3048 | 3051 | ||
| 3049 | default: | 3052 | default: |
| @@ -3066,11 +3069,11 @@ static void ExecuteActionLog( | |||
| 3066 | break; | 3069 | break; |
| 3067 | 3070 | ||
| 3068 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_PROVIDER: | 3071 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_PROVIDER: |
| 3069 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_PROVIDER package id: %ls, action: %u", wzBase, iAction, pAction->packageProvider.pPackage->sczId, pAction->packageProvider.action); | 3072 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_PROVIDER package id: %ls, action: %hs", wzBase, iAction, pAction->packageProvider.pPackage->sczId, LoggingDependencyActionToString(pAction->packageProvider.action)); |
| 3070 | break; | 3073 | break; |
| 3071 | 3074 | ||
| 3072 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 3075 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 3073 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls, action: %u", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey, pAction->packageDependency.action); | 3076 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls, action: %hs", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey, LoggingDependencyActionToString(pAction->packageDependency.action)); |
| 3074 | break; | 3077 | break; |
| 3075 | 3078 | ||
| 3076 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: | 3079 | case BURN_EXECUTE_ACTION_TYPE_EXE_PACKAGE: |
| @@ -3078,15 +3081,15 @@ static void ExecuteActionLog( | |||
| 3078 | break; | 3081 | break; |
| 3079 | 3082 | ||
| 3080 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 3083 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
| 3081 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %u, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), pAction->msiPackage.actionMsiProperty, pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); | 3084 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), LoggingBurnMsiPropertyToString(pAction->msiPackage.actionMsiProperty), pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); |
| 3082 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) | 3085 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) |
| 3083 | { | 3086 | { |
| 3084 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches->dwOrder, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); | 3087 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); |
| 3085 | } | 3088 | } |
| 3086 | break; | 3089 | break; |
| 3087 | 3090 | ||
| 3088 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: | 3091 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: |
| 3089 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %u, ui level: %u, disable externaluihandler: %ls, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", pAction->mspTarget.actionMsiProperty, pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath); | 3092 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %ls, ui level: %u, disable externaluihandler: %ls, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", LoggingBurnMsiPropertyToString(pAction->mspTarget.actionMsiProperty), pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath); |
| 3090 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) | 3093 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) |
| 3091 | { | 3094 | { |
| 3092 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); | 3095 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); |
| @@ -3106,7 +3109,7 @@ static void ExecuteActionLog( | |||
| 3106 | break; | 3109 | break; |
| 3107 | 3110 | ||
| 3108 | case BURN_EXECUTE_ACTION_TYPE_WAIT_SYNCPOINT: | 3111 | case BURN_EXECUTE_ACTION_TYPE_WAIT_SYNCPOINT: |
| 3109 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: WAIT_SYNCPOINT event handle: 0x%x", wzBase, iAction, pAction->syncpoint.hEvent); | 3112 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: WAIT_SYNCPOINT event handle: 0x%p", wzBase, iAction, pAction->syncpoint.hEvent); |
| 3110 | break; | 3113 | break; |
| 3111 | 3114 | ||
| 3112 | case BURN_EXECUTE_ACTION_TYPE_UNCACHE_PACKAGE: | 3115 | case BURN_EXECUTE_ACTION_TYPE_UNCACHE_PACKAGE: |
| @@ -3131,6 +3134,7 @@ extern "C" void PlanDump( | |||
| 3131 | 3134 | ||
| 3132 | LogStringLine(REPORT_STANDARD, "Plan action: %hs", LoggingBurnActionToString(pPlan->action)); | 3135 | LogStringLine(REPORT_STANDARD, "Plan action: %hs", LoggingBurnActionToString(pPlan->action)); |
| 3133 | LogStringLine(REPORT_STANDARD, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); | 3136 | LogStringLine(REPORT_STANDARD, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); |
| 3137 | LogStringLine(REPORT_STANDARD, " disable-rollback: %hs", LoggingTrueFalseToString(pPlan->fDisableRollback)); | ||
| 3134 | LogStringLine(REPORT_STANDARD, " keep registration by default: %hs", LoggingTrueFalseToString(pPlan->fKeepRegistrationDefault)); | 3138 | LogStringLine(REPORT_STANDARD, " keep registration by default: %hs", LoggingTrueFalseToString(pPlan->fKeepRegistrationDefault)); |
| 3135 | LogStringLine(REPORT_STANDARD, " estimated size: %llu", pPlan->qwEstimatedSize); | 3139 | LogStringLine(REPORT_STANDARD, " estimated size: %llu", pPlan->qwEstimatedSize); |
| 3136 | 3140 | ||
diff --git a/src/engine/plan.h b/src/engine/plan.h index 4fd3380e..5fddd72f 100644 --- a/src/engine/plan.h +++ b/src/engine/plan.h | |||
| @@ -325,6 +325,7 @@ typedef struct _BURN_PLAN | |||
| 325 | DWORD dwRegistrationOperations; | 325 | DWORD dwRegistrationOperations; |
| 326 | BOOL fKeepRegistrationDefault; | 326 | BOOL fKeepRegistrationDefault; |
| 327 | BOOL fDisallowRemoval; | 327 | BOOL fDisallowRemoval; |
| 328 | BOOL fDisableRollback; | ||
| 328 | 329 | ||
| 329 | DWORD64 qwCacheSizeTotal; | 330 | DWORD64 qwCacheSizeTotal; |
| 330 | 331 | ||
| @@ -366,6 +367,8 @@ typedef struct _BURN_PLAN | |||
| 366 | BURN_CACHE_PAYLOAD_PROGRESS* rgPayloadProgress; | 367 | BURN_CACHE_PAYLOAD_PROGRESS* rgPayloadProgress; |
| 367 | DWORD cPayloadProgress; | 368 | DWORD cPayloadProgress; |
| 368 | STRINGDICT_HANDLE shPayloadProgress; | 369 | STRINGDICT_HANDLE shPayloadProgress; |
| 370 | |||
| 371 | DWORD dwNextCheckpointId; | ||
| 369 | } BURN_PLAN; | 372 | } BURN_PLAN; |
| 370 | 373 | ||
| 371 | 374 | ||
