aboutsummaryrefslogtreecommitdiff
path: root/src/burn/engine/relatedbundle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/relatedbundle.cpp')
-rw-r--r--src/burn/engine/relatedbundle.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp
index d3c856a6..4a694ef6 100644
--- a/src/burn/engine/relatedbundle.cpp
+++ b/src/burn/engine/relatedbundle.cpp
@@ -21,7 +21,7 @@ static HRESULT LoadRelatedBundleFromKey(
21 __in HKEY hkBundleId, 21 __in HKEY hkBundleId,
22 __in BOOL fPerMachine, 22 __in BOOL fPerMachine,
23 __in BOOTSTRAPPER_RELATION_TYPE relationType, 23 __in BOOTSTRAPPER_RELATION_TYPE relationType,
24 __inout BURN_RELATED_BUNDLE *pRelatedBundle 24 __in BURN_RELATED_BUNDLE *pRelatedBundle
25 ); 25 );
26 26
27 27
@@ -398,21 +398,34 @@ static HRESULT LoadRelatedBundleFromKey(
398 __in HKEY hkBundleId, 398 __in HKEY hkBundleId,
399 __in BOOL fPerMachine, 399 __in BOOL fPerMachine,
400 __in BOOTSTRAPPER_RELATION_TYPE relationType, 400 __in BOOTSTRAPPER_RELATION_TYPE relationType,
401 __inout BURN_RELATED_BUNDLE* pRelatedBundle 401 __in BURN_RELATED_BUNDLE* pRelatedBundle
402 ) 402 )
403{ 403{
404 HRESULT hr = S_OK; 404 HRESULT hr = S_OK;
405 DWORD64 qwEngineVersion = 0; 405 DWORD64 qwEngineVersion = 0;
406 DWORD dwEngineProtocolVersion = 0;
407 BOOL fSupportsBurnProtocol = FALSE;
406 LPWSTR sczBundleVersion = NULL; 408 LPWSTR sczBundleVersion = NULL;
407 LPWSTR sczCachePath = NULL; 409 LPWSTR sczCachePath = NULL;
408 BOOL fCached = FALSE; 410 BOOL fCached = FALSE;
409 DWORD64 qwFileSize = 0; 411 DWORD64 qwFileSize = 0;
410 BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; 412 BURN_DEPENDENCY_PROVIDER dependencyProvider = { };
411 413
412 hr = RegReadVersion(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion); 414 // Only support progress from engines that are compatible.
413 if (FAILED(hr)) 415 hr = RegReadNumber(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion);
416 if (SUCCEEDED(hr))
417 {
418 fSupportsBurnProtocol = BURN_PROTOCOL_VERSION == dwEngineProtocolVersion;
419 }
420 else
414 { 421 {
415 qwEngineVersion = 0; 422 // Rely on version checking (aka: version greater than or equal to last protocol breaking change *and* versions that are older or the same as this engine)
423 hr = RegReadVersion(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion);
424 if (SUCCEEDED(hr))
425 {
426 fSupportsBurnProtocol = (FILEMAKEVERSION(3, 6, 2221, 0) <= qwEngineVersion && qwEngineVersion <= FILEMAKEVERSION(rmj, rmm, rup, rpr));
427 }
428
416 hr = S_OK; 429 hr = S_OK;
417 } 430 }
418 431
@@ -467,7 +480,7 @@ static HRESULT LoadRelatedBundleFromKey(
467 480
468 pRelatedBundle->relationType = relationType; 481 pRelatedBundle->relationType = relationType;
469 482
470 hr = PseudoBundleInitialize(qwEngineVersion, &pRelatedBundle->package, fPerMachine, wzRelatedBundleId, pRelatedBundle->relationType, 483 hr = PseudoBundleInitialize(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleId, pRelatedBundle->relationType,
471 BOOTSTRAPPER_PACKAGE_STATE_PRESENT, fCached, sczCachePath, sczCachePath, NULL, qwFileSize, FALSE, 484 BOOTSTRAPPER_PACKAGE_STATE_PRESENT, fCached, sczCachePath, sczCachePath, NULL, qwFileSize, FALSE,
472 L"-quiet", L"-repair -quiet", L"-uninstall -quiet", 485 L"-quiet", L"-repair -quiet", L"-uninstall -quiet",
473 (dependencyProvider.sczKey && *dependencyProvider.sczKey) ? &dependencyProvider : NULL, 486 (dependencyProvider.sczKey && *dependencyProvider.sczKey) ? &dependencyProvider : NULL,