From 84a1b0f8ffe40a26916b1dfb3e1b59b6b0c31ad4 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Thu, 30 Dec 2021 15:12:26 -0600 Subject: Add BURN_PROTOCOL_VERSION in registration to avoid version checks. Also, old versions of Burn should ignore ancestors if they doesn't support them. --- src/burn/engine/pseudobundle.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/burn/engine/pseudobundle.cpp') diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index 91c6c14f..14dd2b77 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp @@ -4,8 +4,8 @@ extern "C" HRESULT PseudoBundleInitialize( - __in DWORD64 qwEngineVersion, __in BURN_PACKAGE* pPackage, + __in BOOL fSupportsBurnProtocol, __in BOOL fPerMachine, __in_z LPCWSTR wzId, __in BOOTSTRAPPER_RELATION_TYPE relationType, @@ -84,6 +84,9 @@ extern "C" HRESULT PseudoBundleInitialize( pPackage->qwSize = qwSize; pPackage->fVital = fVital; + pPackage->Exe.protocol = fSupportsBurnProtocol ? BURN_EXE_PROTOCOL_TYPE_BURN : BURN_EXE_PROTOCOL_TYPE_NONE; + pPackage->Exe.fSupportsAncestors = TRUE; + hr = StrAllocString(&pPackage->sczId, wzId, 0); ExitOnFailure(hr, "Failed to copy key for pseudo bundle."); @@ -131,12 +134,6 @@ extern "C" HRESULT PseudoBundleInitialize( pPackage->fUninstallable = TRUE; } - // Only support progress from engines that are compatible (aka: version greater than or equal to last protocol breaking change *and* versions that are older or the same as this engine). - pPackage->Exe.protocol = (FILEMAKEVERSION(3, 6, 2221, 0) <= qwEngineVersion && qwEngineVersion <= FILEMAKEVERSION(rmj, rmm, rup, rpr)) ? BURN_EXE_PROTOCOL_TYPE_BURN : BURN_EXE_PROTOCOL_TYPE_NONE; - - // All versions of Burn past v3.9 RTM support suppressing ancestors. - pPackage->Exe.fSupportsAncestors = FILEMAKEVERSION(3, 9, 1006, 0) <= qwEngineVersion; - if (pDependencyProvider) { pPackage->rgDependencyProviders = (BURN_DEPENDENCY_PROVIDER*)MemAlloc(sizeof(BURN_DEPENDENCY_PROVIDER), TRUE); @@ -310,7 +307,7 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( hr = StrAllocString(&pPackage->Exe.sczInstallArguments, wzInstallArguments, 0); ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); - // Assume the update bundle has the same engine version as this one. + // Trust the BA to only use UPDATE_REPLACE_EMBEDDED when appropriate. pPackage->Exe.protocol = BURN_EXE_PROTOCOL_TYPE_BURN; pPackage->Exe.fSupportsAncestors = TRUE; -- cgit v1.2.3-55-g6feb