diff options
Diffstat (limited to 'src/engine/apply.cpp')
-rw-r--r-- | src/engine/apply.cpp | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index b831be9c..4570ffb9 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
@@ -1113,7 +1113,8 @@ static HRESULT ExtractContainer( | |||
1113 | HRESULT hr = S_OK; | 1113 | HRESULT hr = S_OK; |
1114 | BURN_CONTAINER_CONTEXT context = { }; | 1114 | BURN_CONTAINER_CONTEXT context = { }; |
1115 | HANDLE hContainerHandle = INVALID_HANDLE_VALUE; | 1115 | HANDLE hContainerHandle = INVALID_HANDLE_VALUE; |
1116 | LPWSTR sczExtractPayloadId = NULL; | 1116 | LPWSTR sczStreamName = NULL; |
1117 | BURN_PAYLOAD* pExtract = NULL; | ||
1117 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; | 1118 | BURN_CACHE_PROGRESS_CONTEXT progress = { }; |
1118 | 1119 | ||
1119 | progress.pCacheContext = pContext; | 1120 | progress.pCacheContext = pContext; |
@@ -1129,14 +1130,17 @@ static HRESULT ExtractContainer( | |||
1129 | hr = ContainerOpen(&context, pContainer, hContainerHandle, pContainer->sczUnverifiedPath); | 1130 | hr = ContainerOpen(&context, pContainer, hContainerHandle, pContainer->sczUnverifiedPath); |
1130 | ExitOnFailure(hr, "Failed to open container: %ls.", pContainer->sczId); | 1131 | ExitOnFailure(hr, "Failed to open container: %ls.", pContainer->sczId); |
1131 | 1132 | ||
1132 | while (S_OK == (hr = ContainerNextStream(&context, &sczExtractPayloadId))) | 1133 | while (S_OK == (hr = ContainerNextStream(&context, &sczStreamName))) |
1133 | { | 1134 | { |
1134 | BOOL fExtracted = FALSE; | 1135 | BOOL fExtracted = FALSE; |
1135 | 1136 | ||
1136 | for (DWORD iExtract = 0; iExtract < pContext->pPayloads->cPayloads; ++iExtract) | 1137 | hr = PayloadFindEmbeddedBySourcePath(pContext->pPayloads, sczStreamName, &pExtract); |
1138 | if (E_NOTFOUND != hr) | ||
1137 | { | 1139 | { |
1138 | BURN_PAYLOAD* pExtract = pContext->pPayloads->rgPayloads + iExtract; | 1140 | ExitOnFailure(hr, "Failed to find embedded payload by source path: %ls container: %ls", sczStreamName, pContainer->sczId); |
1139 | if (pExtract->sczUnverifiedPath && pExtract->cRemainingInstances && CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczExtractPayloadId, -1, pExtract->sczSourcePath, -1)) | 1141 | |
1142 | // Skip payloads that weren't planned or have already been cached. | ||
1143 | if (pExtract->sczUnverifiedPath && pExtract->cRemainingInstances) | ||
1140 | { | 1144 | { |
1141 | progress.pPayload = pExtract; | 1145 | progress.pPayload = pExtract; |
1142 | 1146 | ||
@@ -1161,17 +1165,16 @@ static HRESULT ExtractContainer( | |||
1161 | } | 1165 | } |
1162 | 1166 | ||
1163 | UserExperienceOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); | 1167 | UserExperienceOnCachePayloadExtractComplete(pContext->pUX, pContainer->sczId, pExtract->sczKey, hr); |
1164 | ExitOnFailure(hr, "Failed to extract payload: %ls from container: %ls", sczExtractPayloadId, pContainer->sczId); | 1168 | ExitOnFailure(hr, "Failed to extract payload: %ls from container: %ls", sczStreamName, pContainer->sczId); |
1165 | 1169 | ||
1166 | fExtracted = TRUE; | 1170 | fExtracted = TRUE; |
1167 | break; | ||
1168 | } | 1171 | } |
1169 | } | 1172 | } |
1170 | 1173 | ||
1171 | if (!fExtracted) | 1174 | if (!fExtracted) |
1172 | { | 1175 | { |
1173 | hr = ContainerSkipStream(&context); | 1176 | hr = ContainerSkipStream(&context); |
1174 | ExitOnFailure(hr, "Failed to skip the extraction of payload: %ls from container: %ls", sczExtractPayloadId, pContainer->sczId); | 1177 | ExitOnFailure(hr, "Failed to skip the extraction of payload: %ls from container: %ls", sczStreamName, pContainer->sczId); |
1175 | } | 1178 | } |
1176 | } | 1179 | } |
1177 | 1180 | ||
@@ -1182,7 +1185,7 @@ static HRESULT ExtractContainer( | |||
1182 | ExitOnFailure(hr, "Failed to extract all payloads from container: %ls", pContainer->sczId); | 1185 | ExitOnFailure(hr, "Failed to extract all payloads from container: %ls", pContainer->sczId); |
1183 | 1186 | ||
1184 | LExit: | 1187 | LExit: |
1185 | ReleaseStr(sczExtractPayloadId); | 1188 | ReleaseStr(sczStreamName); |
1186 | ContainerClose(&context); | 1189 | ContainerClose(&context); |
1187 | 1190 | ||
1188 | return hr; | 1191 | return hr; |