aboutsummaryrefslogtreecommitdiff
path: root/src/engine/detect.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-04-16 09:40:18 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-04-19 23:12:55 -0500
commit941c47e5a3f57ce9626b447a95740b1444e69343 (patch)
tree6225b78f5fc7c8f88a2abf187a6a76d45b36ec26 /src/engine/detect.cpp
parentd32f770ca05748df9e356444c7e617d5eeedb60c (diff)
downloadwix-941c47e5a3f57ce9626b447a95740b1444e69343.tar.gz
wix-941c47e5a3f57ce9626b447a95740b1444e69343.tar.bz2
wix-941c47e5a3f57ce9626b447a95740b1444e69343.zip
Detect a package as cached if any of its payloads exist.
Detect is supposed to be fast, so it can't fully verify every payload for every package. The engine was wasting its time by trying to verify file sizes without the hash. Even worse, it was making decisions during planning based on that insufficient verification. Contributes to #3640
Diffstat (limited to 'src/engine/detect.cpp')
-rw-r--r--src/engine/detect.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/engine/detect.cpp b/src/engine/detect.cpp
index 3a58f3dc..355b49f5 100644
--- a/src/engine/detect.cpp
+++ b/src/engine/detect.cpp
@@ -67,7 +67,7 @@ extern "C" void DetectReset(
67 pPackage->cacheRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN; 67 pPackage->cacheRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN;
68 pPackage->installRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN; 68 pPackage->installRegistrationState = BURN_PACKAGE_REGISTRATION_STATE_UNKNOWN;
69 69
70 pPackage->cache = BURN_CACHE_STATE_NONE; 70 pPackage->fCached = FALSE;
71 for (DWORD iPayload = 0; iPayload < pPackage->cPayloads; ++iPayload) 71 for (DWORD iPayload = 0; iPayload < pPackage->cPayloads; ++iPayload)
72 { 72 {
73 BURN_PACKAGE_PAYLOAD* pPayload = pPackage->rgPayloads + iPayload; 73 BURN_PACKAGE_PAYLOAD* pPayload = pPackage->rgPayloads + iPayload;
@@ -149,10 +149,10 @@ extern "C" HRESULT DetectForwardCompatibleBundles(
149 pRegistration->fForwardCompatibleBundleExists = TRUE; 149 pRegistration->fForwardCompatibleBundleExists = TRUE;
150 } 150 }
151 151
152 hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, BURN_CACHE_STATE_COMPLETE != pRelatedBundle->package.cache); 152 hr = UserExperienceOnDetectForwardCompatibleBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, !pRelatedBundle->package.fCached);
153 ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle."); 153 ExitOnRootFailure(hr, "BA aborted detect forward compatible bundle.");
154 154
155 LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingCacheStateToString(pRelatedBundle->package.cache)); 155 LogId(REPORT_STANDARD, MSG_DETECTED_FORWARD_COMPATIBLE_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingBoolToString(pRelatedBundle->package.fCached));
156 } 156 }
157 } 157 }
158 } 158 }
@@ -225,9 +225,9 @@ extern "C" HRESULT DetectReportRelatedBundles(
225 break; 225 break;
226 } 226 }
227 227
228 LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingRelatedOperationToString(operation), LoggingCacheStateToString(pRelatedBundle->package.cache)); 228 LogId(REPORT_STANDARD, MSG_DETECTED_RELATED_BUNDLE, pRelatedBundle->package.sczId, LoggingRelationTypeToString(pRelatedBundle->relationType), LoggingPerMachineToString(pRelatedBundle->package.fPerMachine), pRelatedBundle->pVersion->sczVersion, LoggingRelatedOperationToString(operation), LoggingBoolToString(pRelatedBundle->package.fCached));
229 229
230 hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation, BURN_CACHE_STATE_COMPLETE != pRelatedBundle->package.cache); 230 hr = UserExperienceOnDetectRelatedBundle(pUX, pRelatedBundle->package.sczId, pRelatedBundle->relationType, pRelatedBundle->sczTag, pRelatedBundle->package.fPerMachine, pRelatedBundle->pVersion, operation, !pRelatedBundle->package.fCached);
231 ExitOnRootFailure(hr, "BA aborted detect related bundle."); 231 ExitOnRootFailure(hr, "BA aborted detect related bundle.");
232 232
233 // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle. 233 // For now, if any related bundles will be executed during uninstall by default then never automatically clean up the bundle.