diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-04-16 10:54:49 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-04-19 23:12:55 -0500 |
commit | 70bb69c0e5f589fb55d3e36a5e81e9a7d0e56814 (patch) | |
tree | 4801fb1961721e29f14824397e7b0b13e14814a5 | |
parent | 22fb11c03329380fcffff253c7b2d4d1fccd23b4 (diff) | |
download | wix-70bb69c0e5f589fb55d3e36a5e81e9a7d0e56814.tar.gz wix-70bb69c0e5f589fb55d3e36a5e81e9a7d0e56814.tar.bz2 wix-70bb69c0e5f589fb55d3e36a5e81e9a7d0e56814.zip |
Remove the package's cache progress when retrying the whole package.
-rw-r--r-- | src/engine/apply.cpp | 75 | ||||
-rw-r--r-- | src/engine/payload.h | 1 | ||||
-rw-r--r-- | src/engine/plan.cpp | 1 |
3 files changed, 47 insertions, 30 deletions
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index bd294dfa..5402e55c 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
@@ -42,7 +42,7 @@ typedef struct _BURN_CACHE_PROGRESS_CONTEXT | |||
42 | BURN_CACHE_PROGRESS_TYPE type; | 42 | BURN_CACHE_PROGRESS_TYPE type; |
43 | BURN_CONTAINER* pContainer; | 43 | BURN_CONTAINER* pContainer; |
44 | BURN_PACKAGE* pPackage; | 44 | BURN_PACKAGE* pPackage; |
45 | BURN_PAYLOAD* pPayload; | 45 | BURN_PAYLOAD_GROUP_ITEM* pPayloadGroupItem; |
46 | 46 | ||
47 | BOOL fCancel; | 47 | BOOL fCancel; |
48 | HRESULT hrError; | 48 | HRESULT hrError; |
@@ -106,7 +106,7 @@ static HRESULT ApplyCacheVerifyContainerOrPayload( | |||
106 | __in BURN_CACHE_CONTEXT* pContext, | 106 | __in BURN_CACHE_CONTEXT* pContext, |
107 | __in_opt BURN_CONTAINER* pContainer, | 107 | __in_opt BURN_CONTAINER* pContainer, |
108 | __in_opt BURN_PACKAGE* pPackage, | 108 | __in_opt BURN_PACKAGE* pPackage, |
109 | __in_opt BURN_PAYLOAD* pPayload | 109 | __in_opt BURN_PAYLOAD_GROUP_ITEM* pPayloadGroupItem |
110 | ); | 110 | ); |
111 | static HRESULT ExtractContainer( | 111 | static HRESULT ExtractContainer( |
112 | __in BURN_CACHE_CONTEXT* pContext, | 112 | __in BURN_CACHE_CONTEXT* pContext, |
@@ -122,7 +122,7 @@ static HRESULT ApplyAcquireContainerOrPayload( | |||
122 | __in BURN_CACHE_CONTEXT* pContext, | 122 | __in BURN_CACHE_CONTEXT* pContext, |
123 | __in_opt BURN_CONTAINER* pContainer, | 123 | __in_opt BURN_CONTAINER* pContainer, |
124 | __in_opt BURN_PACKAGE* pPackage, | 124 | __in_opt BURN_PACKAGE* pPackage, |
125 | __in_opt BURN_PAYLOAD* pPayload | 125 | __in_opt BURN_PAYLOAD_GROUP_ITEM* pPayloadGroupItem |
126 | ); | 126 | ); |
127 | static HRESULT AcquireContainerOrPayload( | 127 | static HRESULT AcquireContainerOrPayload( |
128 | __in BURN_CACHE_PROGRESS_CONTEXT* pProgress, | 128 | __in BURN_CACHE_PROGRESS_CONTEXT* pProgress, |
@@ -829,7 +829,6 @@ static HRESULT ApplyCachePackage( | |||
829 | 829 | ||
830 | if (BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_RETRY == cachePackageCompleteAction) | 830 | if (BOOTSTRAPPER_CACHEPACKAGECOMPLETE_ACTION_RETRY == cachePackageCompleteAction) |
831 | { | 831 | { |
832 | // TODO: the progress needs to account for the payloads (potentially) being recached. | ||
833 | for (DWORD i = 0; i < pPackage->payloads.cItems; ++i) | 832 | for (DWORD i = 0; i < pPackage->payloads.cItems; ++i) |
834 | { | 833 | { |
835 | BURN_PAYLOAD_GROUP_ITEM* pItem = pPackage->payloads.rgItems + i; | 834 | BURN_PAYLOAD_GROUP_ITEM* pItem = pPackage->payloads.rgItems + i; |
@@ -838,6 +837,12 @@ static HRESULT ApplyCachePackage( | |||
838 | pItem->pPayload->cRemainingInstances += 1; | 837 | pItem->pPayload->cRemainingInstances += 1; |
839 | pItem->fCached = FALSE; | 838 | pItem->fCached = FALSE; |
840 | } | 839 | } |
840 | |||
841 | if (pItem->qwCommittedCacheProgress) | ||
842 | { | ||
843 | pContext->qwSuccessfulCacheProgress -= pItem->qwCommittedCacheProgress; | ||
844 | pItem->qwCommittedCacheProgress = 0; | ||
845 | } | ||
841 | } | 846 | } |
842 | 847 | ||
843 | LogErrorId(hr, MSG_APPLY_RETRYING_PACKAGE, pPackage->sczId, NULL, NULL); | 848 | LogErrorId(hr, MSG_APPLY_RETRYING_PACKAGE, pPackage->sczId, NULL, NULL); |
@@ -981,7 +986,7 @@ static HRESULT ApplyProcessPayload( | |||
981 | ExitFunction(); | 986 | ExitFunction(); |
982 | } | 987 | } |
983 | 988 | ||
984 | hr = ApplyCacheVerifyContainerOrPayload(pContext, NULL, pPackage, pPayload); | 989 | hr = ApplyCacheVerifyContainerOrPayload(pContext, NULL, pPackage, pPayloadGroupItem); |
985 | if (SUCCEEDED(hr)) | 990 | if (SUCCEEDED(hr)) |
986 | { | 991 | { |
987 | ExitFunction(); | 992 | ExitFunction(); |
@@ -991,7 +996,7 @@ static HRESULT ApplyProcessPayload( | |||
991 | { | 996 | { |
992 | fRetry = FALSE; | 997 | fRetry = FALSE; |
993 | 998 | ||
994 | hr = ApplyAcquireContainerOrPayload(pContext, NULL, pPackage, pPayload); | 999 | hr = ApplyAcquireContainerOrPayload(pContext, NULL, pPackage, pPayloadGroupItem); |
995 | LogExitOnFailure(hr, MSG_FAILED_ACQUIRE_PAYLOAD, "Failed to acquire payload: %ls to working path: %ls", pPayload->sczKey, pPayload->sczUnverifiedPath); | 1000 | LogExitOnFailure(hr, MSG_FAILED_ACQUIRE_PAYLOAD, "Failed to acquire payload: %ls to working path: %ls", pPayload->sczKey, pPayload->sczUnverifiedPath); |
996 | 1001 | ||
997 | hr = LayoutOrCacheContainerOrPayload(pContext, NULL, pPackage, pPayloadGroupItem, cTryAgainAttempts, &fRetry); | 1002 | hr = LayoutOrCacheContainerOrPayload(pContext, NULL, pPackage, pPayloadGroupItem, cTryAgainAttempts, &fRetry); |
@@ -1009,7 +1014,8 @@ static HRESULT ApplyProcessPayload( | |||
1009 | } | 1014 | } |
1010 | 1015 | ||
1011 | ++cTryAgainAttempts; | 1016 | ++cTryAgainAttempts; |
1012 | pContext->qwSuccessfulCacheProgress -= pPayload->qwFileSize; | 1017 | pContext->qwSuccessfulCacheProgress -= pPayloadGroupItem->qwCommittedCacheProgress; |
1018 | pPayloadGroupItem->qwCommittedCacheProgress = 0; | ||
1013 | ReleaseNullStr(pContext->sczLastUsedFolderCandidate); | 1019 | ReleaseNullStr(pContext->sczLastUsedFolderCandidate); |
1014 | LogErrorId(hr, MSG_APPLY_RETRYING_PAYLOAD, pPayload->sczKey, NULL, NULL); | 1020 | LogErrorId(hr, MSG_APPLY_RETRYING_PAYLOAD, pPayload->sczKey, NULL, NULL); |
1015 | } | 1021 | } |
@@ -1025,20 +1031,21 @@ static HRESULT ApplyCacheVerifyContainerOrPayload( | |||
1025 | __in BURN_CACHE_CONTEXT* pContext, | 1031 | __in BURN_CACHE_CONTEXT* pContext, |
1026 | __in_opt BURN_CONTAINER* pContainer, | 1032 | __in_opt BURN_CONTAINER* pContainer, |
1027 | __in_opt BURN_PACKAGE* pPackage, | 1033 | __in_opt BURN_PACKAGE* pPackage, |
1028 | __in_opt BURN_PAYLOAD* pPayload | 1034 | __in_opt BURN_PAYLOAD_GROUP_ITEM* pPayloadGroupItem |
1029 | ) | 1035 | ) |
1030 | { | 1036 | { |
1031 | AssertSz(pContainer || pPayload, "Must provide a container or a payload."); | 1037 | AssertSz(pContainer || pPayloadGroupItem, "Must provide a container or a payload."); |
1032 | 1038 | ||
1033 | HRESULT hr = S_OK; | 1039 | HRESULT hr = S_OK; |
1034 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; | 1040 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; |
1035 | LPCWSTR wzPackageOrContainerId = pContainer ? pContainer->sczId : pPackage ? pPackage->sczId : NULL; | 1041 | LPCWSTR wzPackageOrContainerId = pContainer ? pContainer->sczId : pPackage ? pPackage->sczId : NULL; |
1036 | LPCWSTR wzPayloadId = pPayload ? pPayload->sczKey : NULL; | 1042 | LPCWSTR wzPayloadId = pPayloadGroupItem ? pPayloadGroupItem->pPayload->sczKey : NULL; |
1043 | DWORD64 qwFileSize = pContainer ? pContainer->qwFileSize : pPayloadGroupItem->pPayload->qwFileSize; | ||
1037 | 1044 | ||
1038 | progress.pCacheContext = pContext; | 1045 | progress.pCacheContext = pContext; |
1039 | progress.pContainer = pContainer; | 1046 | progress.pContainer = pContainer; |
1040 | progress.pPackage = pPackage; | 1047 | progress.pPackage = pPackage; |
1041 | progress.pPayload = pPayload; | 1048 | progress.pPayloadGroupItem = pPayloadGroupItem; |
1042 | progress.type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; | 1049 | progress.type = BURN_CACHE_PROGRESS_TYPE_CONTAINER_OR_PAYLOAD_VERIFY; |
1043 | 1050 | ||
1044 | hr = UserExperienceOnCacheContainerOrPayloadVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId); | 1051 | hr = UserExperienceOnCacheContainerOrPayloadVerifyBegin(pContext->pUX, wzPackageOrContainerId, wzPayloadId); |
@@ -1046,7 +1053,7 @@ static HRESULT ApplyCacheVerifyContainerOrPayload( | |||
1046 | 1053 | ||
1047 | if (INVALID_HANDLE_VALUE != pContext->hPipe) | 1054 | if (INVALID_HANDLE_VALUE != pContext->hPipe) |
1048 | { | 1055 | { |
1049 | hr = ElevationCacheVerifyContainerOrPayload(pContext->hPipe, pContainer, pPackage, pPayload, pContext->wzLayoutDirectory); | 1056 | hr = ElevationCacheVerifyContainerOrPayload(pContext->hPipe, pContainer, pPackage, pPayloadGroupItem->pPayload, pContext->wzLayoutDirectory); |
1050 | } | 1057 | } |
1051 | else if (pContainer) | 1058 | else if (pContainer) |
1052 | { | 1059 | { |
@@ -1054,7 +1061,7 @@ static HRESULT ApplyCacheVerifyContainerOrPayload( | |||
1054 | } | 1061 | } |
1055 | else | 1062 | else |
1056 | { | 1063 | { |
1057 | hr = CacheVerifyPayload(pPayload, pContext->wzLayoutDirectory ? pContext->wzLayoutDirectory : pPackage->sczCacheFolder); | 1064 | hr = CacheVerifyPayload(pPayloadGroupItem->pPayload, pContext->wzLayoutDirectory ? pContext->wzLayoutDirectory : pPackage->sczCacheFolder); |
1058 | } | 1065 | } |
1059 | 1066 | ||
1060 | // This was best effort to avoid acquiring the container or payload. | 1067 | // This was best effort to avoid acquiring the container or payload. |
@@ -1063,9 +1070,13 @@ static HRESULT ApplyCacheVerifyContainerOrPayload( | |||
1063 | ExitFunction(); | 1070 | ExitFunction(); |
1064 | } | 1071 | } |
1065 | 1072 | ||
1066 | pContext->qwSuccessfulCacheProgress += pContainer ? pContainer->qwFileSize : pPayload->qwFileSize; | 1073 | pContext->qwSuccessfulCacheProgress += qwFileSize; |
1074 | if (pPayloadGroupItem) | ||
1075 | { | ||
1076 | pPayloadGroupItem->qwCommittedCacheProgress += qwFileSize; | ||
1077 | } | ||
1067 | 1078 | ||
1068 | hr = CompleteCacheProgress(&progress, pContainer ? pContainer->qwFileSize : pPayload->qwFileSize); | 1079 | hr = CompleteCacheProgress(&progress, qwFileSize); |
1069 | 1080 | ||
1070 | LExit: | 1081 | LExit: |
1071 | UserExperienceOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr); | 1082 | UserExperienceOnCacheContainerOrPayloadVerifyComplete(pContext->pUX, wzPackageOrContainerId, wzPayloadId, hr); |
@@ -1275,10 +1286,10 @@ static HRESULT ApplyAcquireContainerOrPayload( | |||
1275 | __in BURN_CACHE_CONTEXT* pContext, | 1286 | __in BURN_CACHE_CONTEXT* pContext, |
1276 | __in_opt BURN_CONTAINER* pContainer, | 1287 | __in_opt BURN_CONTAINER* pContainer, |
1277 | __in_opt BURN_PACKAGE* pPackage, | 1288 | __in_opt BURN_PACKAGE* pPackage, |
1278 | __in_opt BURN_PAYLOAD* pPayload | 1289 | __in_opt BURN_PAYLOAD_GROUP_ITEM* pPayloadGroupItem |
1279 | ) | 1290 | ) |
1280 | { | 1291 | { |
1281 | AssertSz(pContainer || pPayload, "Must provide a container or a payload."); | 1292 | AssertSz(pContainer || pPayloadGroupItem, "Must provide a container or a payload."); |
1282 | 1293 | ||
1283 | HRESULT hr = S_OK; | 1294 | HRESULT hr = S_OK; |
1284 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; | 1295 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; |
@@ -1288,7 +1299,7 @@ static HRESULT ApplyAcquireContainerOrPayload( | |||
1288 | progress.type = BURN_CACHE_PROGRESS_TYPE_ACQUIRE; | 1299 | progress.type = BURN_CACHE_PROGRESS_TYPE_ACQUIRE; |
1289 | progress.pContainer = pContainer; | 1300 | progress.pContainer = pContainer; |
1290 | progress.pPackage = pPackage; | 1301 | progress.pPackage = pPackage; |
1291 | progress.pPayload = pPayload; | 1302 | progress.pPayloadGroupItem = pPayloadGroupItem; |
1292 | 1303 | ||
1293 | do | 1304 | do |
1294 | { | 1305 | { |
@@ -1297,10 +1308,10 @@ static HRESULT ApplyAcquireContainerOrPayload( | |||
1297 | if (fRetry) | 1308 | if (fRetry) |
1298 | { | 1309 | { |
1299 | hr = S_OK; | 1310 | hr = S_OK; |
1300 | LogErrorId(hr, pContainer ? MSG_APPLY_RETRYING_ACQUIRE_CONTAINER : MSG_APPLY_RETRYING_ACQUIRE_PAYLOAD, pContainer ? pContainer->sczId : pPayload->sczKey, NULL, NULL); | 1311 | LogErrorId(hr, pContainer ? MSG_APPLY_RETRYING_ACQUIRE_CONTAINER : MSG_APPLY_RETRYING_ACQUIRE_PAYLOAD, pContainer ? pContainer->sczId : pPayloadGroupItem->pPayload->sczKey, NULL, NULL); |
1301 | } | 1312 | } |
1302 | 1313 | ||
1303 | ExitOnFailure(hr, "Failed to acquire %hs: %ls", pContainer ? "container" : "payload", pContainer ? pContainer->sczId : pPayload->sczKey); | 1314 | ExitOnFailure(hr, "Failed to acquire %hs: %ls", pContainer ? "container" : "payload", pContainer ? pContainer->sczId : pPayloadGroupItem->pPayload->sczKey); |
1304 | } while (fRetry); | 1315 | } while (fRetry); |
1305 | 1316 | ||
1306 | LExit: | 1317 | LExit: |
@@ -1315,7 +1326,7 @@ static HRESULT AcquireContainerOrPayload( | |||
1315 | BURN_CACHE_CONTEXT* pContext = pProgress->pCacheContext; | 1326 | BURN_CACHE_CONTEXT* pContext = pProgress->pCacheContext; |
1316 | BURN_CONTAINER* pContainer = pProgress->pContainer; | 1327 | BURN_CONTAINER* pContainer = pProgress->pContainer; |
1317 | BURN_PACKAGE* pPackage = pProgress->pPackage; | 1328 | BURN_PACKAGE* pPackage = pProgress->pPackage; |
1318 | BURN_PAYLOAD* pPayload = pProgress->pPayload; | 1329 | BURN_PAYLOAD* pPayload = pProgress->pPayloadGroupItem ? pProgress->pPayloadGroupItem->pPayload : NULL; |
1319 | AssertSz(pContainer || pPayload, "Must provide a container or a payload."); | 1330 | AssertSz(pContainer || pPayload, "Must provide a container or a payload."); |
1320 | 1331 | ||
1321 | HRESULT hr = S_OK; | 1332 | HRESULT hr = S_OK; |
@@ -1473,7 +1484,7 @@ static HRESULT LayoutOrCacheContainerOrPayload( | |||
1473 | progress.type = BURN_CACHE_PROGRESS_TYPE_VERIFY; | 1484 | progress.type = BURN_CACHE_PROGRESS_TYPE_VERIFY; |
1474 | progress.pContainer = pContainer; | 1485 | progress.pContainer = pContainer; |
1475 | progress.pPackage = pPackage; | 1486 | progress.pPackage = pPackage; |
1476 | progress.pPayload = pPayload; | 1487 | progress.pPayloadGroupItem = pPayloadGroupItem; |
1477 | 1488 | ||
1478 | do | 1489 | do |
1479 | { | 1490 | { |
@@ -1570,11 +1581,11 @@ static HRESULT CopyPayload( | |||
1570 | { | 1581 | { |
1571 | HRESULT hr = S_OK; | 1582 | HRESULT hr = S_OK; |
1572 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : L""; | 1583 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : L""; |
1573 | LPCWSTR wzPayloadId = pProgress->pPayload ? pProgress->pPayload->sczKey : L""; | 1584 | LPCWSTR wzPayloadId = pProgress->pPayloadGroupItem ? pProgress->pPayloadGroupItem->pPayload->sczKey : L""; |
1574 | HANDLE hDestinationFile = INVALID_HANDLE_VALUE; | 1585 | HANDLE hDestinationFile = INVALID_HANDLE_VALUE; |
1575 | HANDLE hSourceOpenedFile = INVALID_HANDLE_VALUE; | 1586 | HANDLE hSourceOpenedFile = INVALID_HANDLE_VALUE; |
1576 | 1587 | ||
1577 | DWORD dwLogId = pProgress->pContainer ? (pProgress->pPayload ? MSG_ACQUIRE_CONTAINER_PAYLOAD : MSG_ACQUIRE_CONTAINER) : pProgress->pPackage ? MSG_ACQUIRE_PACKAGE_PAYLOAD : MSG_ACQUIRE_BUNDLE_PAYLOAD; | 1588 | DWORD dwLogId = pProgress->pContainer ? (pProgress->pPayloadGroupItem ? MSG_ACQUIRE_CONTAINER_PAYLOAD : MSG_ACQUIRE_CONTAINER) : pProgress->pPackage ? MSG_ACQUIRE_PACKAGE_PAYLOAD : MSG_ACQUIRE_BUNDLE_PAYLOAD; |
1578 | LogId(REPORT_STANDARD, dwLogId, wzPackageOrContainerId, wzPayloadId, "copy", wzSourcePath); | 1589 | LogId(REPORT_STANDARD, dwLogId, wzPackageOrContainerId, wzPayloadId, "copy", wzSourcePath); |
1579 | 1590 | ||
1580 | hr = PreparePayloadDestinationPath(wzDestinationPath); | 1591 | hr = PreparePayloadDestinationPath(wzDestinationPath); |
@@ -1630,14 +1641,14 @@ static HRESULT DownloadPayload( | |||
1630 | { | 1641 | { |
1631 | HRESULT hr = S_OK; | 1642 | HRESULT hr = S_OK; |
1632 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : L""; | 1643 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : L""; |
1633 | LPCWSTR wzPayloadId = pProgress->pPayload ? pProgress->pPayload->sczKey : L""; | 1644 | LPCWSTR wzPayloadId = pProgress->pPayloadGroupItem ? pProgress->pPayloadGroupItem->pPayload->sczKey : L""; |
1634 | DOWNLOAD_SOURCE* pDownloadSource = pProgress->pContainer ? &pProgress->pContainer->downloadSource : &pProgress->pPayload->downloadSource; | 1645 | DOWNLOAD_SOURCE* pDownloadSource = pProgress->pContainer ? &pProgress->pContainer->downloadSource : &pProgress->pPayloadGroupItem->pPayload->downloadSource; |
1635 | DWORD64 qwDownloadSize = pProgress->pContainer ? pProgress->pContainer->qwFileSize : pProgress->pPayload->qwFileSize; | 1646 | DWORD64 qwDownloadSize = pProgress->pContainer ? pProgress->pContainer->qwFileSize : pProgress->pPayloadGroupItem->pPayload->qwFileSize; |
1636 | DOWNLOAD_CACHE_CALLBACK cacheCallback = { }; | 1647 | DOWNLOAD_CACHE_CALLBACK cacheCallback = { }; |
1637 | DOWNLOAD_AUTHENTICATION_CALLBACK authenticationCallback = { }; | 1648 | DOWNLOAD_AUTHENTICATION_CALLBACK authenticationCallback = { }; |
1638 | APPLY_AUTHENTICATION_REQUIRED_DATA authenticationData = { }; | 1649 | APPLY_AUTHENTICATION_REQUIRED_DATA authenticationData = { }; |
1639 | 1650 | ||
1640 | DWORD dwLogId = pProgress->pContainer ? (pProgress->pPayload ? MSG_ACQUIRE_CONTAINER_PAYLOAD : MSG_ACQUIRE_CONTAINER) : pProgress->pPackage ? MSG_ACQUIRE_PACKAGE_PAYLOAD : MSG_ACQUIRE_BUNDLE_PAYLOAD; | 1651 | DWORD dwLogId = pProgress->pContainer ? (pProgress->pPayloadGroupItem ? MSG_ACQUIRE_CONTAINER_PAYLOAD : MSG_ACQUIRE_CONTAINER) : pProgress->pPackage ? MSG_ACQUIRE_PACKAGE_PAYLOAD : MSG_ACQUIRE_BUNDLE_PAYLOAD; |
1641 | LogId(REPORT_STANDARD, dwLogId, wzPackageOrContainerId, wzPayloadId, "download", pDownloadSource->sczUrl); | 1652 | LogId(REPORT_STANDARD, dwLogId, wzPackageOrContainerId, wzPayloadId, "download", pDownloadSource->sczUrl); |
1642 | 1653 | ||
1643 | hr = PreparePayloadDestinationPath(wzDestinationPath); | 1654 | hr = PreparePayloadDestinationPath(wzDestinationPath); |
@@ -1736,11 +1747,15 @@ static HRESULT CompleteCacheProgress( | |||
1736 | if (PROGRESS_CONTINUE == dwResult) | 1747 | if (PROGRESS_CONTINUE == dwResult) |
1737 | { | 1748 | { |
1738 | pContext->pCacheContext->qwSuccessfulCacheProgress += qwFileSize; | 1749 | pContext->pCacheContext->qwSuccessfulCacheProgress += qwFileSize; |
1750 | if (pContext->pPayloadGroupItem) | ||
1751 | { | ||
1752 | pContext->pPayloadGroupItem->qwCommittedCacheProgress += qwFileSize; | ||
1753 | } | ||
1739 | 1754 | ||
1740 | if (BURN_CACHE_PROGRESS_TYPE_VERIFY == pContext->type && pContext->pCacheContext->sczLastUsedFolderCandidate) | 1755 | if (BURN_CACHE_PROGRESS_TYPE_VERIFY == pContext->type && pContext->pCacheContext->sczLastUsedFolderCandidate) |
1741 | { | 1756 | { |
1742 | // We successfully copied from a source location, set that as the last used source. | 1757 | // We successfully copied from a source location, set that as the last used source. |
1743 | CacheSetLastUsedSource(pContext->pCacheContext->pVariables, pContext->pCacheContext->sczLastUsedFolderCandidate, pContext->pContainer ? pContext->pContainer->sczFilePath : pContext->pPayload->sczFilePath); | 1758 | CacheSetLastUsedSource(pContext->pCacheContext->pVariables, pContext->pCacheContext->sczLastUsedFolderCandidate, pContext->pContainer ? pContext->pContainer->sczFilePath : pContext->pPayloadGroupItem->pPayload->sczFilePath); |
1744 | } | 1759 | } |
1745 | } | 1760 | } |
1746 | else if (PROGRESS_CANCEL == dwResult) | 1761 | else if (PROGRESS_CANCEL == dwResult) |
@@ -1774,7 +1789,7 @@ static DWORD CALLBACK CacheProgressRoutine( | |||
1774 | DWORD dwResult = PROGRESS_CONTINUE; | 1789 | DWORD dwResult = PROGRESS_CONTINUE; |
1775 | BURN_CACHE_PROGRESS_CONTEXT* pProgress = static_cast<BURN_CACHE_PROGRESS_CONTEXT*>(lpData); | 1790 | BURN_CACHE_PROGRESS_CONTEXT* pProgress = static_cast<BURN_CACHE_PROGRESS_CONTEXT*>(lpData); |
1776 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : NULL; | 1791 | LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : NULL; |
1777 | LPCWSTR wzPayloadId = pProgress->pPayload ? pProgress->pPayload->sczKey : NULL; | 1792 | LPCWSTR wzPayloadId = pProgress->pPayloadGroupItem ? pProgress->pPayloadGroupItem->pPayload->sczKey : NULL; |
1778 | DWORD64 qwCacheProgress = pProgress->pCacheContext->qwSuccessfulCacheProgress + TotalBytesTransferred.QuadPart; | 1793 | DWORD64 qwCacheProgress = pProgress->pCacheContext->qwSuccessfulCacheProgress + TotalBytesTransferred.QuadPart; |
1779 | if (qwCacheProgress > pProgress->pCacheContext->qwTotalCacheSize) | 1794 | if (qwCacheProgress > pProgress->pCacheContext->qwTotalCacheSize) |
1780 | { | 1795 | { |
diff --git a/src/engine/payload.h b/src/engine/payload.h index 75132269..aa174d66 100644 --- a/src/engine/payload.h +++ b/src/engine/payload.h | |||
@@ -62,6 +62,7 @@ typedef struct _BURN_PAYLOAD_GROUP_ITEM | |||
62 | 62 | ||
63 | // mutable members | 63 | // mutable members |
64 | BOOL fCached; | 64 | BOOL fCached; |
65 | DWORD64 qwCommittedCacheProgress; | ||
65 | } BURN_PAYLOAD_GROUP_ITEM; | 66 | } BURN_PAYLOAD_GROUP_ITEM; |
66 | 67 | ||
67 | typedef struct _BURN_PAYLOAD_GROUP | 68 | typedef struct _BURN_PAYLOAD_GROUP |
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index f7434216..55fe7ddf 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
@@ -1854,6 +1854,7 @@ static void ResetPlannedPayloadGroupState( | |||
1854 | BURN_PAYLOAD_GROUP_ITEM* pItem = pPayloadGroup->rgItems + i; | 1854 | BURN_PAYLOAD_GROUP_ITEM* pItem = pPayloadGroup->rgItems + i; |
1855 | 1855 | ||
1856 | pItem->fCached = FALSE; | 1856 | pItem->fCached = FALSE; |
1857 | pItem->qwCommittedCacheProgress = 0; | ||
1857 | } | 1858 | } |
1858 | } | 1859 | } |
1859 | 1860 | ||