From 523c66a62a619e6aa9f30070173ea33edfb5e328 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 29 Dec 2024 18:01:20 -0800 Subject: Rename "bundle id" concept to "bundle code" The "bundle id" always had more in common with the PackageCode from the Windows Installer. With the introduction of an actual Id attribute on the Bundle element, there is potential for confusion, so there is finally real motivation to rename "bundle id" to "bundle code". --- src/burn/engine/EngineForExtension.cpp | 2 +- src/burn/engine/apply.cpp | 4 +- src/burn/engine/bacallback.cpp | 56 ++++++++--------- src/burn/engine/bacallback.h | 14 ++--- src/burn/engine/baengine.cpp | 12 ++-- src/burn/engine/bundlepackageengine.cpp | 46 +++++++------- src/burn/engine/cache.cpp | 18 +++--- src/burn/engine/cache.h | 4 +- src/burn/engine/core.cpp | 10 ++-- src/burn/engine/dependency.cpp | 38 ++++++------ src/burn/engine/dependency.h | 4 +- src/burn/engine/detect.cpp | 24 ++++---- src/burn/engine/detect.h | 2 +- src/burn/engine/elevation.cpp | 24 ++++---- src/burn/engine/elevation.h | 4 +- src/burn/engine/externalengine.cpp | 4 +- src/burn/engine/externalengine.h | 2 +- src/burn/engine/package.h | 2 +- src/burn/engine/plan.cpp | 24 ++++---- src/burn/engine/plan.h | 4 +- src/burn/engine/registration.cpp | 22 +++---- src/burn/engine/registration.h | 6 +- src/burn/engine/relatedbundle.cpp | 58 +++++++++--------- src/burn/engine/section.cpp | 8 +-- src/burn/stub/StubSection.cpp | 2 +- src/burn/test/BurnUnitTest/ManifestTest.cpp | 2 +- src/burn/test/BurnUnitTest/PlanTest.cpp | 70 +++++++++++----------- src/burn/test/BurnUnitTest/RegistrationTest.cpp | 26 ++++---- src/burn/test/BurnUnitTest/RelatedBundleTest.cpp | 14 ++--- .../BasicFunctionality_BundleA_manifest.xml | 4 +- .../PlanTest/BundlePackage_Multiple_manifest.xml | 12 ++-- .../ExePackage_PerUserArpEntry_manifest.xml | 4 +- .../TestData/PlanTest/Failure_BundleD_manifest.xml | 4 +- .../PlanTest/MsiTransaction_BundleAv1_manifest.xml | 4 +- .../PlanTest/MsuPackageFixture_manifest.xml | 4 +- .../PlanTest/Slipstream_BundleA_manifest.xml | 4 +- .../Slipstream_BundleA_modified_manifest.xml | 4 +- 37 files changed, 273 insertions(+), 273 deletions(-) (limited to 'src/burn') diff --git a/src/burn/engine/EngineForExtension.cpp b/src/burn/engine/EngineForExtension.cpp index e19cb802..3f7db0d4 100644 --- a/src/burn/engine/EngineForExtension.cpp +++ b/src/burn/engine/EngineForExtension.cpp @@ -213,7 +213,7 @@ static HRESULT BEEngineGetRelatedBundleVariable( ValidateMessageArgs(hr, pvArgs, BOOTSTRAPPER_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_ARGS, pArgs); ValidateMessageResults(hr, pvResults, BOOTSTRAPPER_EXTENSION_ENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS, pResults); - hr = ExternalEngineGetRelatedBundleVariable(pContext->pEngineState, pArgs->wzBundleId, pArgs->wzVariable, pResults->wzValue, &pResults->cchValue); + hr = ExternalEngineGetRelatedBundleVariable(pContext->pEngineState, pArgs->wzBundleCode, pArgs->wzVariable, pResults->wzValue, &pResults->cchValue); LExit: return hr; diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 0f65b0ad..e4e76a6c 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp @@ -452,7 +452,7 @@ extern "C" HRESULT ApplyRegister( if (pEngineState->registration.fPerMachine) { - hr = ElevationSessionBegin(pEngineState->companionConnection.hPipe, sczEngineWorkingPath, pEngineState->registration.sczResumeCommandLine, pEngineState->registration.fDisableResume, &pEngineState->variables, pEngineState->plan.dwRegistrationOperations, pEngineState->registration.fDetectedForeignProviderKeyBundleId, qwEstimatedSize, registrationType); + hr = ElevationSessionBegin(pEngineState->companionConnection.hPipe, sczEngineWorkingPath, pEngineState->registration.sczResumeCommandLine, pEngineState->registration.fDisableResume, &pEngineState->variables, pEngineState->plan.dwRegistrationOperations, pEngineState->registration.fDetectedForeignProviderKeyBundleCode, qwEstimatedSize, registrationType); ExitOnFailure(hr, "Failed to begin registration session in per-machine process."); } else @@ -548,7 +548,7 @@ extern "C" HRESULT ApplyUnregister( if (pEngineState->registration.fPerMachine) { - hr = ElevationSessionEnd(pEngineState->companionConnection.hPipe, resumeMode, restart, pEngineState->registration.fDetectedForeignProviderKeyBundleId, qwEstimatedSize, registrationType); + hr = ElevationSessionEnd(pEngineState->companionConnection.hPipe, resumeMode, restart, pEngineState->registration.fDetectedForeignProviderKeyBundleCode, qwEstimatedSize, registrationType); ExitOnFailure(hr, "Failed to end session in per-machine process."); } else diff --git a/src/burn/engine/bacallback.cpp b/src/burn/engine/bacallback.cpp index f4e6894d..72ca27ea 100644 --- a/src/burn/engine/bacallback.cpp +++ b/src/burn/engine/bacallback.cpp @@ -2120,7 +2120,7 @@ LExit: EXTERN_C HRESULT BACallbackOnDetectForwardCompatibleBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -2138,7 +2138,7 @@ EXTERN_C HRESULT BACallbackOnDetectForwardCompatibleBundle( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.relationType = relationType; args.wzBundleTag = wzBundleTag; args.fPerMachine = fPerMachine; @@ -2151,8 +2151,8 @@ EXTERN_C HRESULT BACallbackOnDetectForwardCompatibleBundle( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnDetectForwardCompatibleBundle args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnDetectForwardCompatibleBundle args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnDetectForwardCompatibleBundle args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.relationType); ExitOnFailure(hr, "Failed to write relation type of OnDetectForwardCompatibleBundle args."); @@ -2393,7 +2393,7 @@ LExit: EXTERN_C HRESULT BACallbackOnDetectRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -2411,7 +2411,7 @@ EXTERN_C HRESULT BACallbackOnDetectRelatedBundle( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.relationType = relationType; args.wzBundleTag = wzBundleTag; args.fPerMachine = fPerMachine; @@ -2424,8 +2424,8 @@ EXTERN_C HRESULT BACallbackOnDetectRelatedBundle( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnDetectRelatedBundle args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnDetectRelatedBundle args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnDetectRelatedBundle args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.relationType); ExitOnFailure(hr, "Failed to write relation type of OnDetectRelatedBundle args."); @@ -2478,7 +2478,7 @@ LExit: EXTERN_C HRESULT BACallbackOnDetectRelatedBundlePackage( __in BURN_USER_EXPERIENCE* pUserExperience, __in_z LPCWSTR wzPackageId, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BOOL fPerMachine, __in VERUTIL_VERSION* pVersion @@ -2495,7 +2495,7 @@ EXTERN_C HRESULT BACallbackOnDetectRelatedBundlePackage( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; args.wzPackageId = wzPackageId; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.relationType = relationType; args.fPerMachine = fPerMachine; args.wzVersion = pVersion->sczVersion; @@ -2509,8 +2509,8 @@ EXTERN_C HRESULT BACallbackOnDetectRelatedBundlePackage( hr = BuffWriteStringToBuffer(&bufferArgs, args.wzPackageId); ExitOnFailure(hr, "Failed to write package id of OnDetectRelatedBundlePackage args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnDetectRelatedBundlePackage args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnDetectRelatedBundlePackage args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.relationType); ExitOnFailure(hr, "Failed to write relation type of OnDetectRelatedBundlePackage args."); @@ -4315,7 +4315,7 @@ LExit: EXTERN_C HRESULT BACallbackOnPlanForwardCompatibleBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -4333,7 +4333,7 @@ EXTERN_C HRESULT BACallbackOnPlanForwardCompatibleBundle( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.relationType = relationType; args.wzBundleTag = wzBundleTag; args.fPerMachine = fPerMachine; @@ -4347,8 +4347,8 @@ EXTERN_C HRESULT BACallbackOnPlanForwardCompatibleBundle( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnPlanForwardCompatibleBundle args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnPlanForwardCompatibleBundle args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnPlanForwardCompatibleBundle args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.relationType); ExitOnFailure(hr, "Failed to write relation type of OnPlanForwardCompatibleBundle args."); @@ -4806,7 +4806,7 @@ LExit: EXTERN_C HRESULT BACallbackOnPlanRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState ) { @@ -4820,7 +4820,7 @@ EXTERN_C HRESULT BACallbackOnPlanRelatedBundle( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.recommendedState = *pRequestedState; results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; @@ -4830,8 +4830,8 @@ EXTERN_C HRESULT BACallbackOnPlanRelatedBundle( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnPlanRelatedBundle args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnPlanRelatedBundle args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnPlanRelatedBundle args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.recommendedState); ExitOnFailure(hr, "Failed to write recommended state of OnPlanRelatedBundle args."); @@ -4879,7 +4879,7 @@ LExit: EXTERN_C HRESULT BACallbackOnPlanRelatedBundleType( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE* pRequestedType ) { @@ -4893,7 +4893,7 @@ EXTERN_C HRESULT BACallbackOnPlanRelatedBundleType( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.recommendedType = *pRequestedType; results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; @@ -4903,8 +4903,8 @@ EXTERN_C HRESULT BACallbackOnPlanRelatedBundleType( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnPlanRelatedBundleType args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnPlanRelatedBundleType args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnPlanRelatedBundleType args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.recommendedType); ExitOnFailure(hr, "Failed to write recommended type of OnPlanRelatedBundleType args."); @@ -4952,7 +4952,7 @@ LExit: EXTERN_C HRESULT BACallbackOnPlanRestoreRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState ) { @@ -4966,7 +4966,7 @@ EXTERN_C HRESULT BACallbackOnPlanRestoreRelatedBundle( // Init structs. args.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; - args.wzBundleId = wzBundleId; + args.wzBundleCode = wzBundleCode; args.recommendedState = *pRequestedState; results.dwApiVersion = WIX_5_BOOTSTRAPPER_APPLICATION_API_VERSION; @@ -4976,8 +4976,8 @@ EXTERN_C HRESULT BACallbackOnPlanRestoreRelatedBundle( hr = BuffWriteNumberToBuffer(&bufferArgs, args.dwApiVersion); ExitOnFailure(hr, "Failed to write API version of OnPlanRestoreRelatedBundle args."); - hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleId); - ExitOnFailure(hr, "Failed to write bundle id of OnPlanRestoreRelatedBundle args."); + hr = BuffWriteStringToBuffer(&bufferArgs, args.wzBundleCode); + ExitOnFailure(hr, "Failed to write bundle code of OnPlanRestoreRelatedBundle args."); hr = BuffWriteNumberToBuffer(&bufferArgs, args.recommendedState); ExitOnFailure(hr, "Failed to write recommended state of OnPlanRestoreRelatedBundle args."); diff --git a/src/burn/engine/bacallback.h b/src/burn/engine/bacallback.h index 8d1f41c4..cd363b6e 100644 --- a/src/burn/engine/bacallback.h +++ b/src/burn/engine/bacallback.h @@ -193,7 +193,7 @@ HRESULT BACallbackOnDetectComplete( ); HRESULT BACallbackOnDetectForwardCompatibleBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -219,7 +219,7 @@ HRESULT BACallbackOnDetectPackageComplete( ); HRESULT BACallbackOnDetectRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -229,7 +229,7 @@ HRESULT BACallbackOnDetectRelatedBundle( HRESULT BACallbackOnDetectRelatedBundlePackage( __in BURN_USER_EXPERIENCE* pUserExperience, __in_z LPCWSTR wzPackageId, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BOOL fPerMachine, __in VERUTIL_VERSION* pVersion @@ -388,7 +388,7 @@ HRESULT BACallbackOnPlanComplete( ); HRESULT BACallbackOnPlanForwardCompatibleBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in_z LPCWSTR wzBundleTag, __in BOOL fPerMachine, @@ -443,17 +443,17 @@ HRESULT BACallbackOnPlanPackageComplete( ); HRESULT BACallbackOnPlanRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState ); HRESULT BACallbackOnPlanRelatedBundleType( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_RELATED_BUNDLE_PLAN_TYPE* pRequestedType ); HRESULT BACallbackOnPlanRestoreRelatedBundle( __in BURN_USER_EXPERIENCE* pUserExperience, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __inout BOOTSTRAPPER_REQUEST_STATE* pRequestedState ); HRESULT BACallbackOnPlanRollbackBoundary( diff --git a/src/burn/engine/baengine.cpp b/src/burn/engine/baengine.cpp index e63836f4..d1704ad9 100644 --- a/src/burn/engine/baengine.cpp +++ b/src/burn/engine/baengine.cpp @@ -330,7 +330,7 @@ static HRESULT BAEngineGetRelatedBundleVariable( HRESULT hr = S_OK; BAENGINE_GETRELATEDBUNDLEVARIABLE_ARGS args = { }; BAENGINE_GETRELATEDBUNDLEVARIABLE_RESULTS results = { }; - LPWSTR sczBundleId = NULL; + LPWSTR sczBundleCode = NULL; LPWSTR sczVariable = NULL; LPWSTR sczValue = NULL; @@ -338,13 +338,13 @@ static HRESULT BAEngineGetRelatedBundleVariable( hr = BuffReaderReadNumber(pReaderArgs, &args.dwApiVersion); ExitOnFailure(hr, "Failed to read API version of BAEngineGetRelatedBundleVariable args."); - hr = BuffReaderReadString(pReaderArgs, &sczBundleId); - ExitOnFailure(hr, "Failed to read bundle id of BAEngineGetRelatedBundleVariable args."); + hr = BuffReaderReadString(pReaderArgs, &sczBundleCode); + ExitOnFailure(hr, "Failed to read bundle code of BAEngineGetRelatedBundleVariable args."); hr = BuffReaderReadString(pReaderArgs, &sczVariable); ExitOnFailure(hr, "Failed to read variable name of BAEngineGetRelatedBundleVariable args."); - args.wzBundleId = sczBundleId; + args.wzBundleCode = sczBundleCode; args.wzVariable = sczVariable; // Read results. @@ -355,7 +355,7 @@ static HRESULT BAEngineGetRelatedBundleVariable( ExitOnFailure(hr, "Failed to read API version of BAEngineGetRelatedBundleVariable results."); // Execute. - hr = BundleGetBundleVariable(args.wzBundleId, args.wzVariable, &sczValue); + hr = BundleGetBundleVariable(args.wzBundleCode, args.wzVariable, &sczValue); ExitOnFailure(hr, "Failed to get related bundle variable: %ls", sczVariable); results.cchValue = lstrlenW(sczValue); @@ -374,7 +374,7 @@ static HRESULT BAEngineGetRelatedBundleVariable( LExit: ReleaseStr(sczValue); ReleaseStr(sczVariable); - ReleaseStr(sczBundleId); + ReleaseStr(sczBundleCode); return hr; } diff --git a/src/burn/engine/bundlepackageengine.cpp b/src/burn/engine/bundlepackageengine.cpp index 90262638..612da389 100644 --- a/src/burn/engine/bundlepackageengine.cpp +++ b/src/burn/engine/bundlepackageengine.cpp @@ -52,8 +52,8 @@ extern "C" HRESULT BundlePackageEngineParsePackageFromXml( LPWSTR scz = NULL; // @DetectCondition - hr = XmlGetAttributeEx(pixnBundlePackage, L"BundleId", &pPackage->Bundle.sczBundleId); - ExitOnRequiredXmlQueryFailure(hr, "Failed to get @BundleId."); + hr = XmlGetAttributeEx(pixnBundlePackage, L"BundleCode", &pPackage->Bundle.sczBundleCode); + ExitOnRequiredXmlQueryFailure(hr, "Failed to get @BundleCode."); // @Version hr = XmlGetAttributeEx(pixnBundlePackage, L"Version", &scz); @@ -100,7 +100,7 @@ extern "C" HRESULT BundlePackageEngineParsePackageFromXml( hr = ExeEngineParseCommandLineArgumentsFromXml(pixnBundlePackage, &pPackage->Bundle.rgCommandLineArguments, &pPackage->Bundle.cCommandLineArguments); ExitOnFailure(hr, "Failed to parse command lines."); - hr = StrAllocFormatted(&pPackage->Bundle.sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pPackage->Bundle.sczBundleId); + hr = StrAllocFormatted(&pPackage->Bundle.sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pPackage->Bundle.sczBundleCode); ExitOnFailure(hr, "Failed to build uninstall registry key path."); LExit: @@ -126,7 +126,7 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( IXMLDOMNodeList* pixnNodes = NULL; IXMLDOMNode* pixnElement = NULL; LPWSTR sczAction = NULL; - LPWSTR sczId = NULL; + LPWSTR sczCode = NULL; DWORD cElements = 0; hr = XmlSelectNodes(pixnBundle, L"RelatedBundle", &pixnNodes); @@ -143,16 +143,16 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( hr = XmlGetAttributeEx(pixnElement, L"Action", &sczAction); ExitOnFailure(hr, "Failed to get @Action."); - hr = XmlGetAttributeEx(pixnElement, L"Id", &sczId); - ExitOnFailure(hr, "Failed to get @Id."); + hr = XmlGetAttributeEx(pixnElement, L"Code", &sczCode); + ExitOnFailure(hr, "Failed to get @Code."); if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Detect", -1)) { hr = MemEnsureArraySizeForNewItems(reinterpret_cast(prgsczDetectCodes), *pcDetectCodes, 1, sizeof(LPWSTR), 5); ExitOnFailure(hr, "Failed to resize Detect code array"); - (*prgsczDetectCodes)[*pcDetectCodes] = sczId; - sczId = NULL; + (*prgsczDetectCodes)[*pcDetectCodes] = sczCode; + sczCode = NULL; *pcDetectCodes += 1; } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Upgrade", -1)) @@ -160,8 +160,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( hr = MemEnsureArraySizeForNewItems(reinterpret_cast(prgsczUpgradeCodes), *pcUpgradeCodes, 1, sizeof(LPWSTR), 5); ExitOnFailure(hr, "Failed to resize Upgrade code array"); - (*prgsczUpgradeCodes)[*pcUpgradeCodes] = sczId; - sczId = NULL; + (*prgsczUpgradeCodes)[*pcUpgradeCodes] = sczCode; + sczCode = NULL; *pcUpgradeCodes += 1; } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Addon", -1)) @@ -169,8 +169,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( hr = MemEnsureArraySizeForNewItems(reinterpret_cast(prgsczAddonCodes), *pcAddonCodes, 1, sizeof(LPWSTR), 5); ExitOnFailure(hr, "Failed to resize Addon code array"); - (*prgsczAddonCodes)[*pcAddonCodes] = sczId; - sczId = NULL; + (*prgsczAddonCodes)[*pcAddonCodes] = sczCode; + sczCode = NULL; *pcAddonCodes += 1; } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, sczAction, -1, L"Patch", -1)) @@ -178,8 +178,8 @@ extern "C" HRESULT BundlePackageEngineParseRelatedCodes( hr = MemEnsureArraySizeForNewItems(reinterpret_cast(prgsczPatchCodes), *pcPatchCodes, 1, sizeof(LPWSTR), 5); ExitOnFailure(hr, "Failed to resize Patch code array"); - (*prgsczPatchCodes)[*pcPatchCodes] = sczId; - sczId = NULL; + (*prgsczPatchCodes)[*pcPatchCodes] = sczCode; + sczCode = NULL; *pcPatchCodes += 1; } else @@ -193,7 +193,7 @@ LExit: ReleaseObject(pixnNodes); ReleaseObject(pixnElement); ReleaseStr(sczAction); - ReleaseStr(sczId); + ReleaseStr(sczCode); return hr; } @@ -202,7 +202,7 @@ extern "C" void BundlePackageEnginePackageUninitialize( __in BURN_PACKAGE* pPackage ) { - ReleaseStr(pPackage->Bundle.sczBundleId); + ReleaseStr(pPackage->Bundle.sczBundleCode); ReleaseStr(pPackage->Bundle.sczArpKeyPath); ReleaseVerutilVersion(pPackage->Bundle.pVersion); ReleaseStr(pPackage->Bundle.sczRegistrationKey); @@ -457,7 +457,7 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage( pAction->bundlePackage.pPackage = pPackage; pAction->bundlePackage.action = pPackage->rollback; - hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0); + hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleCode, 0); ExitOnFailure(hr, "Failed to allocate the parent."); if (pPackage->Bundle.wzAncestors) @@ -488,7 +488,7 @@ extern "C" HRESULT BundlePackageEnginePlanAddPackage( pAction->bundlePackage.pPackage = pPackage; pAction->bundlePackage.action = pPackage->execute; - hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleId, 0); + hr = StrAllocString(&pAction->bundlePackage.sczParent, pPlan->wzBundleCode, 0); ExitOnFailure(hr, "Failed to allocate the parent."); if (pPackage->Bundle.wzAncestors) @@ -686,7 +686,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback( BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType); BOOL fPerMachine = BUNDLE_INSTALL_CONTEXT_MACHINE == pBundle->installContext; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleId, -1, pPackage->Bundle.sczBundleId, -1) && + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleCode, -1, pPackage->Bundle.sczBundleCode, -1) && pPackage->Bundle.fWin64 == (REG_KEY_64BIT == pBundle->regBitness)) { Assert(BOOTSTRAPPER_RELATION_UPGRADE == relationType); @@ -695,14 +695,14 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback( } hr = RegReadString(pBundle->hkBundle, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion); - ExitOnFailure(hr, "Failed to read version from registry for related bundle package: %ls", pBundle->wzBundleId); + ExitOnFailure(hr, "Failed to read version from registry for related bundle package: %ls", pBundle->wzBundleCode); hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pVersion); ExitOnFailure(hr, "Failed to parse related bundle package version: %ls", sczBundleVersion); if (pVersion->fInvalid) { - LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, pBundle->wzBundleId, sczBundleVersion); + LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, pBundle->wzBundleCode, sczBundleVersion); } if (BOOTSTRAPPER_RELATION_UPGRADE == relationType) @@ -719,7 +719,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback( result = BUNDLE_QUERY_CALLBACK_RESULT_CANCEL; // Pass to BA. - hr = BACallbackOnDetectRelatedBundlePackage(pContext->pUserExperience, pPackage->sczId, pBundle->wzBundleId, relationType, fPerMachine, pVersion); + hr = BACallbackOnDetectRelatedBundlePackage(pContext->pUserExperience, pPackage->sczId, pBundle->wzBundleCode, relationType, fPerMachine, pVersion); ExitOnRootFailure(hr, "BA aborted detect related BUNDLE package."); result = BUNDLE_QUERY_CALLBACK_RESULT_CONTINUE; @@ -1064,7 +1064,7 @@ static HRESULT DetectArpEntry( if (!pPackage->Bundle.sczArpKeyPath) { - hr = PathConcatRelativeToBase(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\", pPackage->Bundle.sczBundleId, &pPackage->Bundle.sczArpKeyPath); + hr = PathConcatRelativeToBase(L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\", pPackage->Bundle.sczBundleCode, &pPackage->Bundle.sczArpKeyPath); ExitOnFailure(hr, "Failed to build full key path."); } diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index 358327a2..5a8388c4 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp @@ -259,7 +259,7 @@ extern "C" HRESULT CacheInitializeSources( ExitOnFailure(hr, "Failed to get current process path."); // Determine if we are running from the package cache or not. - hr = CacheGetCompletedPath(pCache, pRegistration->fPerMachine, pRegistration->sczId, &sczCompletedFolder); + hr = CacheGetCompletedPath(pCache, pRegistration->fPerMachine, pRegistration->sczCode, &sczCompletedFolder); ExitOnFailure(hr, "Failed to get completed path for bundle."); hr = PathConcatRelativeToFullyQualifiedBase(sczCompletedFolder, pRegistration->sczExecutableName, &sczCompletedPath); @@ -432,7 +432,7 @@ LExit: extern "C" HRESULT CacheCalculateBundleLayoutWorkingPath( __in BURN_CACHE* pCache, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __deref_out_z LPWSTR* psczWorkingPath ) { @@ -440,8 +440,8 @@ extern "C" HRESULT CacheCalculateBundleLayoutWorkingPath( HRESULT hr = S_OK; - hr = PathConcatRelativeToFullyQualifiedBase(pCache->sczAcquisitionFolder, wzBundleId, psczWorkingPath); - ExitOnFailure(hr, "Failed to append bundle id for bundle layout working path."); + hr = PathConcatRelativeToFullyQualifiedBase(pCache->sczAcquisitionFolder, wzBundleCode, psczWorkingPath); + ExitOnFailure(hr, "Failed to append bundle code for bundle layout working path."); LExit: return hr; @@ -978,7 +978,7 @@ extern "C" HRESULT CacheCompleteBundle( __in BURN_CACHE* pCache, __in BOOL fPerMachine, __in_z LPCWSTR wzExecutableName, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in_z LPCWSTR wzSourceBundlePath #ifdef DEBUG , __in_z LPCWSTR wzExecutablePath @@ -990,7 +990,7 @@ extern "C" HRESULT CacheCompleteBundle( LPWSTR sczTargetDirectory = NULL; LPWSTR sczTargetPath = NULL; - hr = CreateCompletedPath(pCache, fPerMachine, wzBundleId, NULL, &sczTargetDirectory); + hr = CreateCompletedPath(pCache, fPerMachine, wzBundleCode, NULL, &sczTargetDirectory); ExitOnFailure(hr, "Failed to create completed cache path for bundle."); hr = PathConcatRelativeToFullyQualifiedBase(sczTargetDirectory, wzExecutableName, &sczTargetPath); @@ -1217,13 +1217,13 @@ extern "C" HRESULT CacheRemoveBaseWorkingFolder( extern "C" HRESULT CacheRemoveBundle( __in BURN_CACHE* pCache, __in BOOL fPerMachine, - __in_z LPCWSTR wzBundleId + __in_z LPCWSTR wzBundleCode ) { HRESULT hr = S_OK; - hr = RemoveBundleOrPackage(pCache, TRUE, fPerMachine, wzBundleId, wzBundleId); - ExitOnFailure(hr, "Failed to remove bundle id: %ls.", wzBundleId); + hr = RemoveBundleOrPackage(pCache, TRUE, fPerMachine, wzBundleCode, wzBundleCode); + ExitOnFailure(hr, "Failed to remove bundle code: %ls.", wzBundleCode); LExit: return hr; diff --git a/src/burn/engine/cache.h b/src/burn/engine/cache.h index 7c4dfaa1..cce35df0 100644 --- a/src/burn/engine/cache.h +++ b/src/burn/engine/cache.h @@ -107,7 +107,7 @@ HRESULT CacheCalculateBundleWorkingPath( ); HRESULT CacheCalculateBundleLayoutWorkingPath( __in BURN_CACHE* pCache, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __deref_out_z LPWSTR* psczWorkingPath ); HRESULT CacheCalculatePayloadWorkingPath( @@ -191,7 +191,7 @@ HRESULT CacheCompleteBundle( __in BURN_CACHE* pCache, __in BOOL fPerMachine, __in_z LPCWSTR wzExecutableName, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in_z LPCWSTR wzSourceBundlePath #ifdef DEBUG , __in_z LPCWSTR wzExecutablePath diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index a85e6f18..3fe9b586 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp @@ -202,12 +202,12 @@ extern "C" HRESULT CoreInitializeConstants( // Support passing Ancestors to embedded burn bundles. if (pInternalCommand->sczAncestors && *pInternalCommand->sczAncestors) { - hr = StrAllocFormatted(&pRegistration->sczBundlePackageAncestors, L"%ls;%ls", pInternalCommand->sczAncestors, pRegistration->sczId); + hr = StrAllocFormatted(&pRegistration->sczBundlePackageAncestors, L"%ls;%ls", pInternalCommand->sczAncestors, pRegistration->sczCode); ExitOnFailure(hr, "Failed to copy ancestors and self to bundle package ancestors."); } else { - hr = StrAllocString(&pRegistration->sczBundlePackageAncestors, pRegistration->sczId, 0); + hr = StrAllocString(&pRegistration->sczBundlePackageAncestors, pRegistration->sczCode, 0); ExitOnFailure(hr, "Failed to copy self to bundle package ancestors."); } @@ -330,7 +330,7 @@ extern "C" HRESULT CoreDetect( ExitOnFailure(hr, "Failed to report detected related bundles."); // Do update detection. - hr = DetectUpdate(pEngineState->registration.sczId, &pEngineState->userExperience, &pEngineState->update); + hr = DetectUpdate(pEngineState->registration.sczCode, &pEngineState->userExperience, &pEngineState->update); ExitOnFailure(hr, "Failed to detect update."); // Detecting MSPs requires special initialization before processing each package but @@ -462,8 +462,8 @@ extern "C" HRESULT CorePlan( pEngineState->plan.pCommand = &pEngineState->command; pEngineState->plan.pInternalCommand = &pEngineState->internalCommand; pEngineState->plan.pPayloads = &pEngineState->payloads; - pEngineState->plan.wzBundleId = pEngineState->registration.sczId; - pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczId; + pEngineState->plan.wzBundleCode = pEngineState->registration.sczCode; + pEngineState->plan.wzBundleProviderKey = pEngineState->registration.sczCode; pEngineState->plan.fDisableRollback = pEngineState->fDisableRollback || BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action; pEngineState->plan.fPlanPackageCacheRollback = BOOTSTRAPPER_REGISTRATION_TYPE_NONE == pEngineState->registration.detectedRegistrationType; diff --git a/src/burn/engine/dependency.cpp b/src/burn/engine/dependency.cpp index d6698680..f398a070 100644 --- a/src/burn/engine/dependency.cpp +++ b/src/burn/engine/dependency.cpp @@ -200,10 +200,10 @@ extern "C" HRESULT DependencyInitialize( HRESULT hr = S_OK; - // If no parent was specified at all, use the bundle id as the self dependent. + // If no parent was specified at all, use the bundle code as the self dependent. if (!pInternalCommand->sczActiveParent) { - pDependencies->wzSelfDependent = pRegistration->sczId; + pDependencies->wzSelfDependent = pRegistration->sczCode; } else if (*pInternalCommand->sczActiveParent) // if parent was specified use that as the self dependent. { @@ -243,30 +243,30 @@ extern "C" void DependencyUninitialize( memset(pDependencies, 0, sizeof(BURN_DEPENDENCIES)); } -extern "C" HRESULT DependencyDetectProviderKeyBundleId( +extern "C" HRESULT DependencyDetectProviderKeyBundleCode( __in BURN_REGISTRATION* pRegistration ) { HRESULT hr = S_OK; - hr = DepGetProviderInformation(pRegistration->hkRoot, pRegistration->sczProviderKey, &pRegistration->sczDetectedProviderKeyBundleId, NULL, NULL); + hr = DepGetProviderInformation(pRegistration->hkRoot, pRegistration->sczProviderKey, &pRegistration->sczDetectedProviderKeyBundleCode, NULL, NULL); if (E_NOTFOUND == hr) { - ReleaseNullStr(pRegistration->sczDetectedProviderKeyBundleId); + ReleaseNullStr(pRegistration->sczDetectedProviderKeyBundleCode); ExitFunction1(hr = S_OK); } - ExitOnFailure(hr, "Failed to get provider key bundle id."); + ExitOnFailure(hr, "Failed to get provider key bundle code."); - // If a bundle id was not explicitly set, default the provider key bundle id to this bundle's provider key. - if (!pRegistration->sczDetectedProviderKeyBundleId || !*pRegistration->sczDetectedProviderKeyBundleId) + // If a bundle code was not explicitly set, default the provider key bundle code to this bundle's provider key. + if (!pRegistration->sczDetectedProviderKeyBundleCode || !*pRegistration->sczDetectedProviderKeyBundleCode) { - hr = StrAllocString(&pRegistration->sczDetectedProviderKeyBundleId, pRegistration->sczProviderKey, 0); - ExitOnFailure(hr, "Failed to initialize provider key bundle id."); + hr = StrAllocString(&pRegistration->sczDetectedProviderKeyBundleCode, pRegistration->sczProviderKey, 0); + ExitOnFailure(hr, "Failed to initialize provider key bundle code."); } - else if (CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczId, -1, pRegistration->sczDetectedProviderKeyBundleId, -1)) + else if (CSTR_EQUAL != ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczCode, -1, pRegistration->sczDetectedProviderKeyBundleCode, -1)) { - pRegistration->fDetectedForeignProviderKeyBundleId = TRUE; - LogId(REPORT_STANDARD, MSG_DETECTED_FOREIGN_BUNDLE_PROVIDER_REGISTRATION, pRegistration->sczProviderKey, pRegistration->sczDetectedProviderKeyBundleId); + pRegistration->fDetectedForeignProviderKeyBundleCode = TRUE; + LogId(REPORT_STANDARD, MSG_DETECTED_FOREIGN_BUNDLE_PROVIDER_REGISTRATION, pRegistration->sczProviderKey, pRegistration->sczDetectedProviderKeyBundleCode); } LExit: @@ -281,8 +281,8 @@ extern "C" HRESULT DependencyDetectBundle( HRESULT hr = S_OK; BOOL fExists = FALSE; - hr = DependencyDetectProviderKeyBundleId(pRegistration); - ExitOnFailure(hr, "Failed to detect provider key bundle id."); + hr = DependencyDetectProviderKeyBundleCode(pRegistration); + ExitOnFailure(hr, "Failed to detect provider key bundle code."); hr = DepCheckDependents(pRegistration->hkRoot, pRegistration->sczProviderKey, 0, NULL, &pRegistration->rgDependents, &pRegistration->cDependents); ExitOnPathFailure(hr, fExists, "Failed dependents check on bundle."); @@ -794,7 +794,7 @@ extern "C" HRESULT DependencyRegisterBundle( LogId(REPORT_VERBOSE, MSG_DEPENDENCY_BUNDLE_REGISTER, pRegistration->sczProviderKey, pRegistration->pVersion->sczVersion); // Register the bundle provider key. - hr = DepRegisterDependency(pRegistration->hkRoot, pRegistration->sczProviderKey, pRegistration->pVersion->sczVersion, pRegistration->sczDisplayName, pRegistration->sczId, 0); + hr = DepRegisterDependency(pRegistration->hkRoot, pRegistration->sczProviderKey, pRegistration->pVersion->sczVersion, pRegistration->sczDisplayName, pRegistration->sczCode, 0); ExitOnFailure(hr, "Failed to register the bundle dependency provider."); LExit: @@ -835,10 +835,10 @@ extern "C" void DependencyUnregisterBundle( ) { HRESULT hr = S_OK; - LPCWSTR wzDependentProviderKey = pRegistration->sczId; + LPCWSTR wzDependentProviderKey = pRegistration->sczCode; // If we own the bundle dependency then remove it. - if (!pRegistration->fDetectedForeignProviderKeyBundleId) + if (!pRegistration->fDetectedForeignProviderKeyBundleCode) { // Remove the bundle provider key. hr = DepUnregisterDependency(pRegistration->hkRoot, pRegistration->sczProviderKey); @@ -969,7 +969,7 @@ static HRESULT DetectPackageDependents( { DEPENDENCY* pDependent = pProvider->rgDependents + iDependent; - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczId, -1, pDependent->sczKey, -1)) + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczCode, -1, pDependent->sczKey, -1)) { pProvider->fBundleRegisteredAsDependent = TRUE; fBundleRegisteredAsDependent = TRUE; diff --git a/src/burn/engine/dependency.h b/src/burn/engine/dependency.h index b5e4050f..d539e9b5 100644 --- a/src/burn/engine/dependency.h +++ b/src/burn/engine/dependency.h @@ -55,12 +55,12 @@ void DependencyUninitialize( ); /******************************************************************** - DependencyDetectProviderKeyBundleId - Detect if the provider key is + DependencyDetectProviderKeyBundleCode - Detect if the provider key is registered and if so what bundle is registered. Note: Returns E_NOTFOUND if the provider key is not registered. *********************************************************************/ -HRESULT DependencyDetectProviderKeyBundleId( +HRESULT DependencyDetectProviderKeyBundleCode( __in BURN_REGISTRATION* pRegistration ); diff --git a/src/burn/engine/detect.cpp b/src/burn/engine/detect.cpp index 18820c5d..08f6b57c 100644 --- a/src/burn/engine/detect.cpp +++ b/src/burn/engine/detect.cpp @@ -18,13 +18,13 @@ static HRESULT WINAPI AuthenticationRequired( ); static HRESULT DetectAtomFeedUpdate( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate ); static HRESULT DownloadUpdateFeed( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate, __deref_inout_z LPWSTR* psczTempFile @@ -38,8 +38,8 @@ extern "C" void DetectReset( ) { RelatedBundlesUninitialize(&pRegistration->relatedBundles); - ReleaseNullStr(pRegistration->sczDetectedProviderKeyBundleId); - pRegistration->fDetectedForeignProviderKeyBundleId = FALSE; + ReleaseNullStr(pRegistration->sczDetectedProviderKeyBundleCode); + pRegistration->fDetectedForeignProviderKeyBundleCode = FALSE; pRegistration->fSelfRegisteredAsDependent = FALSE; pRegistration->fParentRegisteredAsDependent = FALSE; pRegistration->fForwardCompatibleBundleExists = FALSE; @@ -123,14 +123,14 @@ extern "C" HRESULT DetectForwardCompatibleBundles( HRESULT hr = S_OK; int nCompareResult = 0; - if (pRegistration->fDetectedForeignProviderKeyBundleId) + if (pRegistration->fDetectedForeignProviderKeyBundleCode) { for (DWORD iRelatedBundle = 0; iRelatedBundle < pRegistration->relatedBundles.cRelatedBundles; ++iRelatedBundle) { BURN_RELATED_BUNDLE* pRelatedBundle = pRegistration->relatedBundles.rgRelatedBundles + iRelatedBundle; if (BOOTSTRAPPER_RELATION_UPGRADE == pRelatedBundle->detectRelationType && - CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleId, -1, pRelatedBundle->package.sczId, -1)) + CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pRegistration->sczDetectedProviderKeyBundleCode, -1, pRelatedBundle->package.sczId, -1)) { hr = VerCompareParsedVersions(pRegistration->pVersion, pRelatedBundle->pVersion, &nCompareResult); ExitOnFailure(hr, "Failed to compare bundle version '%ls' to related bundle version '%ls'", pRegistration->pVersion->sczVersion, pRelatedBundle->pVersion->sczVersion); @@ -201,7 +201,7 @@ LExit: } extern "C" HRESULT DetectUpdate( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate ) @@ -228,7 +228,7 @@ extern "C" HRESULT DetectUpdate( if (!fSkip) { - hr = DetectAtomFeedUpdate(wzBundleId, pUX, pUpdate); + hr = DetectAtomFeedUpdate(wzBundleCode, pUX, pUpdate); ExitOnFailure(hr, "Failed to detect atom feed update."); } @@ -306,7 +306,7 @@ LExit: } static HRESULT DownloadUpdateFeed( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate, __deref_inout_z LPWSTR* psczTempFile @@ -334,7 +334,7 @@ static HRESULT DownloadUpdateFeed( cacheCallback.pv = NULL; //pProgress; authenticationData.pUX = pUX; - authenticationData.wzPackageOrContainerId = wzBundleId; + authenticationData.wzPackageOrContainerId = wzBundleCode; authenticationCallback.pv = static_cast(&authenticationData); authenticationCallback.pfnAuthenticate = &AuthenticationRequired; @@ -364,7 +364,7 @@ LExit: static HRESULT DetectAtomFeedUpdate( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate ) @@ -385,7 +385,7 @@ static HRESULT DetectAtomFeedUpdate( hr = AtomInitialize(); ExitOnFailure(hr, "Failed to initialize Atom."); - hr = DownloadUpdateFeed(wzBundleId, pUX, pUpdate, &sczUpdateFeedTempFile); + hr = DownloadUpdateFeed(wzBundleCode, pUX, pUpdate, &sczUpdateFeedTempFile); ExitOnFailure(hr, "Failed to download update feed."); hr = AtomParseFromFile(sczUpdateFeedTempFile, &pAtomFeed); diff --git a/src/burn/engine/detect.h b/src/burn/engine/detect.h index cdca2777..a0562ba2 100644 --- a/src/burn/engine/detect.h +++ b/src/burn/engine/detect.h @@ -33,7 +33,7 @@ HRESULT DetectReportRelatedBundles( ); HRESULT DetectUpdate( - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in BURN_USER_EXPERIENCE* pUX, __in BURN_UPDATE* pUpdate ); diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index 924d2184..85d5a543 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp @@ -556,7 +556,7 @@ extern "C" HRESULT ElevationSessionBegin( __in BOOL fDisableResume, __in BURN_VARIABLES* pVariables, __in DWORD dwRegistrationOperations, - __in BOOL fDetectedForeignProviderKeyBundleId, + __in BOOL fDetectedForeignProviderKeyBundleCode, __in DWORD64 qwEstimatedSize, __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType ) @@ -579,7 +579,7 @@ extern "C" HRESULT ElevationSessionBegin( hr = BuffWriteNumber(&pbData, &cbData, dwRegistrationOperations); ExitOnFailure(hr, "Failed to write registration operations to message buffer."); - hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fDetectedForeignProviderKeyBundleId); + hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fDetectedForeignProviderKeyBundleCode); ExitOnFailure(hr, "Failed to write dependency registration action to message buffer."); hr = BuffWriteNumber64(&pbData, &cbData, qwEstimatedSize); @@ -611,7 +611,7 @@ extern "C" HRESULT ElevationSessionEnd( __in HANDLE hPipe, __in BURN_RESUME_MODE resumeMode, __in BOOTSTRAPPER_APPLY_RESTART restart, - __in BOOL fDetectedForeignProviderKeyBundleId, + __in BOOL fDetectedForeignProviderKeyBundleCode, __in DWORD64 qwEstimatedSize, __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType ) @@ -628,7 +628,7 @@ extern "C" HRESULT ElevationSessionEnd( hr = BuffWriteNumber(&pbData, &cbData, (DWORD)restart); ExitOnFailure(hr, "Failed to write restart enum to message buffer."); - hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fDetectedForeignProviderKeyBundleId); + hr = BuffWriteNumber(&pbData, &cbData, (DWORD)fDetectedForeignProviderKeyBundleCode); ExitOnFailure(hr, "Failed to write dependency registration action to message buffer."); hr = BuffWriteNumber64(&pbData, &cbData, qwEstimatedSize); @@ -821,8 +821,8 @@ extern "C" HRESULT ElevationProcessDependentRegistration( hr = BuffWriteNumber(&pbData, &cbData, pAction->type); ExitOnFailure(hr, "Failed to write action type to message buffer."); - hr = BuffWriteString(&pbData, &cbData, pAction->sczBundleId); - ExitOnFailure(hr, "Failed to write bundle id to message buffer."); + hr = BuffWriteString(&pbData, &cbData, pAction->sczBundleCode); + ExitOnFailure(hr, "Failed to write bundle code to message buffer."); hr = BuffWriteString(&pbData, &cbData, pAction->sczDependentProviderKey); ExitOnFailure(hr, "Failed to write dependent provider key to message buffer."); @@ -2559,7 +2559,7 @@ static HRESULT OnSessionBegin( hr = BuffReadNumber(pbData, cbData, &iData, &dwRegistrationOperations); ExitOnFailure(hr, "Failed to read registration operations."); - hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDetectedForeignProviderKeyBundleId); + hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDetectedForeignProviderKeyBundleCode); ExitOnFailure(hr, "Failed to read dependency registration action."); hr = BuffReadNumber64(pbData, cbData, &iData, &qwEstimatedSize); @@ -2604,7 +2604,7 @@ static HRESULT OnSessionEnd( hr = BuffReadNumber(pbData, cbData, &iData, &dwRestart); ExitOnFailure(hr, "Failed to read restart enum."); - hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDetectedForeignProviderKeyBundleId); + hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&pRegistration->fDetectedForeignProviderKeyBundleCode); ExitOnFailure(hr, "Failed to read dependency registration action."); hr = BuffReadNumber64(pbData, cbData, &iData, &qwEstimatedSize); @@ -2810,8 +2810,8 @@ static HRESULT OnProcessDependentRegistration( hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&action.type); ExitOnFailure(hr, "Failed to read action type."); - hr = BuffReadString(pbData, cbData, &iData, &action.sczBundleId); - ExitOnFailure(hr, "Failed to read bundle id."); + hr = BuffReadString(pbData, cbData, &iData, &action.sczBundleCode); + ExitOnFailure(hr, "Failed to read bundle code."); hr = BuffReadString(pbData, cbData, &iData, &action.sczDependentProviderKey); ExitOnFailure(hr, "Failed to read dependent provider key."); @@ -2824,7 +2824,7 @@ LExit: // TODO: do the right thing here. //DependencyUninitializeRegistrationAction(&action); ReleaseStr(action.sczDependentProviderKey); - ReleaseStr(action.sczBundleId) + ReleaseStr(action.sczBundleCode) return hr; } @@ -2854,7 +2854,7 @@ static HRESULT OnExecuteRelatedBundle( // Deserialize message data. hr = BuffReadString(pbData, cbData, &iData, &sczPackage); - ExitOnFailure(hr, "Failed to read related bundle id."); + ExitOnFailure(hr, "Failed to read related bundle code."); hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.relatedBundle.action); ExitOnFailure(hr, "Failed to read action."); diff --git a/src/burn/engine/elevation.h b/src/burn/engine/elevation.h index 02019977..04ad244c 100644 --- a/src/burn/engine/elevation.h +++ b/src/burn/engine/elevation.h @@ -29,7 +29,7 @@ HRESULT ElevationSessionBegin( __in BOOL fDisableResume, __in BURN_VARIABLES* pVariables, __in DWORD dwRegistrationOperations, - __in BOOL fDetectedForeignProviderKeyBundleId, + __in BOOL fDetectedForeignProviderKeyBundleCode, __in DWORD64 qwEstimatedSize, __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType ); @@ -37,7 +37,7 @@ HRESULT ElevationSessionEnd( __in HANDLE hPipe, __in BURN_RESUME_MODE resumeMode, __in BOOTSTRAPPER_APPLY_RESTART restart, - __in BOOL fDetectedForeignProviderKeyBundleId, + __in BOOL fDetectedForeignProviderKeyBundleCode, __in DWORD64 qwEstimatedSize, __in BOOTSTRAPPER_REGISTRATION_TYPE registrationType ); diff --git a/src/burn/engine/externalengine.cpp b/src/burn/engine/externalengine.cpp index 1c775e23..352d184c 100644 --- a/src/burn/engine/externalengine.cpp +++ b/src/burn/engine/externalengine.cpp @@ -837,7 +837,7 @@ LExit: HRESULT ExternalEngineGetRelatedBundleVariable( __in BURN_ENGINE_STATE* /*pEngineState*/, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in_z LPCWSTR wzVariable, __out_ecount_opt(*pcchValue) LPWSTR wzValue, __inout SIZE_T* pcchValue @@ -848,7 +848,7 @@ HRESULT ExternalEngineGetRelatedBundleVariable( if (wzVariable && *wzVariable && pcchValue) { - hr = BundleGetBundleVariable(wzBundleId, wzVariable, &sczValue); + hr = BundleGetBundleVariable(wzBundleCode, wzVariable, &sczValue); if (SUCCEEDED(hr)) { hr = CopyStringToExternal(sczValue, wzValue, pcchValue); diff --git a/src/burn/engine/externalengine.h b/src/burn/engine/externalengine.h index 3569392d..9b95e645 100644 --- a/src/burn/engine/externalengine.h +++ b/src/burn/engine/externalengine.h @@ -133,7 +133,7 @@ HRESULT ExternalEngineCompareVersions( HRESULT ExternalEngineGetRelatedBundleVariable( __in BURN_ENGINE_STATE* pEngineState, - __in_z LPCWSTR wzBundleId, + __in_z LPCWSTR wzBundleCode, __in_z LPCWSTR wzVariable, __out_ecount_opt(*pcchValue) LPWSTR wzValue, __inout SIZE_T* pcchValue diff --git a/src/burn/engine/package.h b/src/burn/engine/package.h index 1ea169e6..d596d7c0 100644 --- a/src/burn/engine/package.h +++ b/src/burn/engine/package.h @@ -323,7 +323,7 @@ typedef struct _BURN_PACKAGE { struct { - LPWSTR sczBundleId; + LPWSTR sczBundleCode; LPWSTR sczArpKeyPath; VERUTIL_VERSION* pVersion; LPWSTR sczRegistrationKey; diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index be281827..47b1c621 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp @@ -74,7 +74,7 @@ static HRESULT AddRegistrationAction( __in BURN_PLAN* pPlan, __in BURN_DEPENDENT_REGISTRATION_ACTION_TYPE type, __in_z LPCWSTR wzDependentProviderKey, - __in_z LPCWSTR wzOwnerBundleId + __in_z LPCWSTR wzOwnerBundleCode ); static HRESULT AddCachePackage( __in BURN_PLAN* pPlan, @@ -467,7 +467,7 @@ extern "C" HRESULT PlanLayoutBundle( hr = StrAllocString(&pCacheAction->bundleLayout.sczExecutableName, wzExecutableName, 0); ExitOnFailure(hr, "Failed to to copy executable name for bundle."); - hr = CacheCalculateBundleLayoutWorkingPath(pPlan->pCache, pPlan->wzBundleId, &pCacheAction->bundleLayout.sczUnverifiedPath); + hr = CacheCalculateBundleLayoutWorkingPath(pPlan->pCache, pPlan->wzBundleCode, &pCacheAction->bundleLayout.sczUnverifiedPath); ExitOnFailure(hr, "Failed to calculate bundle layout working path."); pCacheAction->bundleLayout.qwBundleSize = qwBundleSize; @@ -599,7 +599,7 @@ extern "C" HRESULT PlanRegistration( // If our provider key was not owned by a different bundle, // then plan to write our provider key registration to "fix it" if broken // in case the bundle isn't successfully uninstalled. - if (!pRegistration->fDetectedForeignProviderKeyBundleId) + if (!pRegistration->fDetectedForeignProviderKeyBundleCode) { pPlan->dwRegistrationOperations |= BURN_REGISTRATION_ACTION_OPERATIONS_WRITE_PROVIDER_KEY; } @@ -612,7 +612,7 @@ extern "C" HRESULT PlanRegistration( // would prevent self-removal. if (pRegistration->fSelfRegisteredAsDependent) { - hr = AddRegistrationAction(pPlan, BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_UNREGISTER, pDependencies->wzSelfDependent, pRegistration->sczId); + hr = AddRegistrationAction(pPlan, BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_UNREGISTER, pDependencies->wzSelfDependent, pRegistration->sczCode); ExitOnFailure(hr, "Failed to allocate registration action."); hr = DependencyAddIgnoreDependencies(sdIgnoreDependents, pDependencies->wzSelfDependent); @@ -758,7 +758,7 @@ extern "C" HRESULT PlanRegistration( // as our own dependent. if (pDependencies->wzSelfDependent && !pRegistration->fSelfRegisteredAsDependent && (pDependencies->wzActiveParent || !fAddonOrPatchBundle)) { - hr = AddRegistrationAction(pPlan, BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_REGISTER, pDependencies->wzSelfDependent, pRegistration->sczId); + hr = AddRegistrationAction(pPlan, BURN_DEPENDENT_REGISTRATION_ACTION_TYPE_REGISTER, pDependencies->wzSelfDependent, pRegistration->sczCode); ExitOnFailure(hr, "Failed to add registration action for self dependent."); } } @@ -1439,7 +1439,7 @@ extern "C" HRESULT PlanRelatedBundlesBegin( } else if (E_NOTFOUND != hr) { - ExitOnFailure(hr, "Failed to lookup the bundle ID in the ancestors dictionary."); + ExitOnFailure(hr, "Failed to lookup the bundle code in the ancestors dictionary."); } } else if (fDependent && BOOTSTRAPPER_RELATION_NONE != relationType) @@ -2076,7 +2076,7 @@ static void UninitializeRegistrationAction( ) { ReleaseStr(pAction->sczDependentProviderKey); - ReleaseStr(pAction->sczBundleId); + ReleaseStr(pAction->sczBundleCode); memset(pAction, 0, sizeof(BURN_DEPENDENT_REGISTRATION_ACTION)); } @@ -2271,7 +2271,7 @@ static HRESULT AddRegistrationAction( __in BURN_PLAN* pPlan, __in BURN_DEPENDENT_REGISTRATION_ACTION_TYPE type, __in_z LPCWSTR wzDependentProviderKey, - __in_z LPCWSTR wzOwnerBundleId + __in_z LPCWSTR wzOwnerBundleCode ) { HRESULT hr = S_OK; @@ -2287,7 +2287,7 @@ static HRESULT AddRegistrationAction( pAction->type = type; - hr = StrAllocString(&pAction->sczBundleId, wzOwnerBundleId, 0); + hr = StrAllocString(&pAction->sczBundleCode, wzOwnerBundleCode, 0); ExitOnFailure(hr, "Failed to copy owner bundle to registration action."); hr = StrAllocString(&pAction->sczDependentProviderKey, wzDependentProviderKey, 0); @@ -2302,7 +2302,7 @@ static HRESULT AddRegistrationAction( pAction->type = rollbackType; - hr = StrAllocString(&pAction->sczBundleId, wzOwnerBundleId, 0); + hr = StrAllocString(&pAction->sczBundleCode, wzOwnerBundleCode, 0); ExitOnFailure(hr, "Failed to copy owner bundle to registration action."); hr = StrAllocString(&pAction->sczDependentProviderKey, wzDependentProviderKey, 0); @@ -2880,7 +2880,7 @@ static void DependentRegistrationActionLog( if (wzType) { - LogStringLine(PlanDumpLevel, "%ls action[%u]: %ls bundle id: %ls, provider key: %ls", wzBase, iAction, wzType, pAction->sczBundleId, pAction->sczDependentProviderKey); + LogStringLine(PlanDumpLevel, "%ls action[%u]: %ls bundle code: %ls, provider key: %ls", wzBase, iAction, wzType, pAction->sczBundleCode, pAction->sczDependentProviderKey); } } @@ -3076,7 +3076,7 @@ extern "C" void PlanDump( LogStringLine(PlanDumpLevel, "--- Begin plan dump ---"); LogStringLine(PlanDumpLevel, "Plan action: %hs", LoggingBurnActionToString(pPlan->action)); - LogStringLine(PlanDumpLevel, " bundle id: %ls", pPlan->wzBundleId); + LogStringLine(PlanDumpLevel, " bundle code: %ls", pPlan->wzBundleCode); LogStringLine(PlanDumpLevel, " bundle provider key: %ls", pPlan->wzBundleProviderKey); LogStringLine(PlanDumpLevel, " use-forward-compatible: %hs", LoggingTrueFalseToString(pPlan->fEnabledForwardCompatibleBundle)); LogStringLine(PlanDumpLevel, " per-machine: %hs", LoggingTrueFalseToString(pPlan->fPerMachine)); diff --git a/src/burn/engine/plan.h b/src/burn/engine/plan.h index 386de2c6..03b1423d 100644 --- a/src/burn/engine/plan.h +++ b/src/burn/engine/plan.h @@ -71,7 +71,7 @@ enum BURN_CLEAN_ACTION_TYPE typedef struct _BURN_DEPENDENT_REGISTRATION_ACTION { BURN_DEPENDENT_REGISTRATION_ACTION_TYPE type; - LPWSTR sczBundleId; + LPWSTR sczBundleCode; LPWSTR sczDependentProviderKey; } BURN_DEPENDENT_REGISTRATION_ACTION; @@ -253,7 +253,7 @@ typedef struct _BURN_PLAN BOOTSTRAPPER_COMMAND* pCommand; BURN_ENGINE_COMMAND* pInternalCommand; BURN_PAYLOADS* pPayloads; - LPWSTR wzBundleId; // points directly into parent the ENGINE_STATE. + LPWSTR wzBundleCode; // points directly into parent the ENGINE_STATE. LPWSTR wzBundleProviderKey; // points directly into parent the ENGINE_STATE. BOOL fPerMachine; BOOL fCanAffectMachineState; diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index 771b9425..85c006f7 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp @@ -132,9 +132,9 @@ extern "C" HRESULT RegistrationParseFromXml( hr = XmlSelectSingleNode(pixnBundle, L"Registration", &pixnRegistrationNode); ExitOnRequiredXmlQueryFailure(hr, "Failed to select registration node."); - // @Id - hr = XmlGetAttributeEx(pixnRegistrationNode, L"Id", &pRegistration->sczId); - ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Id."); + // @Code + hr = XmlGetAttributeEx(pixnRegistrationNode, L"Code", &pRegistration->sczCode); + ExitOnRequiredXmlQueryFailure(hr, "Failed to get @Code."); // @Tag hr = XmlGetAttributeEx(pixnRegistrationNode, L"Tag", &pRegistration->sczTag); @@ -305,7 +305,7 @@ extern "C" void RegistrationUninitialize( __in BURN_REGISTRATION* pRegistration ) { - ReleaseStr(pRegistration->sczId); + ReleaseStr(pRegistration->sczCode); ReleaseStr(pRegistration->sczTag); for (DWORD i = 0; i < pRegistration->cDetectCodes; ++i) @@ -371,7 +371,7 @@ extern "C" void RegistrationUninitialize( MemFree(pRegistration->softwareTags.rgSoftwareTags); } - ReleaseStr(pRegistration->sczDetectedProviderKeyBundleId); + ReleaseStr(pRegistration->sczDetectedProviderKeyBundleCode); ReleaseStr(pRegistration->sczBundlePackageAncestors); RelatedBundlesUninitialize(&pRegistration->relatedBundles); @@ -620,7 +620,7 @@ extern "C" HRESULT RegistrationSessionBegin( // Cache bundle executable. if (dwRegistrationOptions & BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE) { - hr = CacheCompleteBundle(pCache, pRegistration->fPerMachine, pRegistration->sczExecutableName, pRegistration->sczId, wzEngineWorkingPath + hr = CacheCompleteBundle(pCache, pRegistration->fPerMachine, pRegistration->sczExecutableName, pRegistration->sczCode, wzEngineWorkingPath #ifdef DEBUG , pRegistration->sczCacheExecutablePath #endif @@ -888,7 +888,7 @@ extern "C" HRESULT RegistrationSessionEnd( hr = RegDelete(pRegistration->hkRoot, pRegistration->sczRegistrationKey, REG_KEY_DEFAULT, TRUE); ExitOnPathFailure(hr, fDeleted, "Failed to delete registration key: %ls", pRegistration->sczRegistrationKey); - CacheRemoveBundle(pCache, pRegistration->fPerMachine, pRegistration->sczId); + CacheRemoveBundle(pCache, pRegistration->fPerMachine, pRegistration->sczCode); } else // the mode needs to be updated so open the registration key. { @@ -1153,11 +1153,11 @@ static HRESULT SetPaths( pRegistration->hkRoot = pRegistration->fPerMachine ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; // build uninstall registry key path - hr = StrAllocFormatted(&pRegistration->sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pRegistration->sczId); + hr = StrAllocFormatted(&pRegistration->sczRegistrationKey, L"%ls\\%ls", BURN_REGISTRATION_REGISTRY_UNINSTALL_KEY, pRegistration->sczCode); ExitOnFailure(hr, "Failed to build uninstall registry key path."); // build cache directory - hr = CacheGetCompletedPath(pCache, pRegistration->fPerMachine, pRegistration->sczId, &sczCacheDirectory); + hr = CacheGetCompletedPath(pCache, pRegistration->fPerMachine, pRegistration->sczCode, &sczCacheDirectory); ExitOnFailure(hr, "Failed to build cache directory."); // build cached executable path @@ -1287,7 +1287,7 @@ static HRESULT UpdateResumeMode( hr = RegCreate(pRegistration->hkRoot, sczResumeKey, KEY_WRITE, &hkRun); ExitOnFailure(hr, "Failed to create run key."); - hr = RegWriteString(hkRun, pRegistration->sczId, sczRunOnceCommandLine); + hr = RegWriteString(hkRun, pRegistration->sczCode, sczRunOnceCommandLine); ExitOnFailure(hr, "Failed to write run key value."); hr = RegWriteString(hkRegistration, REGISTRY_BUNDLE_RESUME_COMMAND_LINE, pRegistration->sczResumeCommandLine); @@ -1304,7 +1304,7 @@ static HRESULT UpdateResumeMode( { ExitOnFailure(hr, "Failed to open run key."); - er = ::RegDeleteValueW(hkRun, pRegistration->sczId); + er = ::RegDeleteValueW(hkRun, pRegistration->sczCode); if (ERROR_FILE_NOT_FOUND == er) { er = ERROR_SUCCESS; diff --git a/src/burn/engine/registration.h b/src/burn/engine/registration.h index 91c3fdcd..326f21c6 100644 --- a/src/burn/engine/registration.h +++ b/src/burn/engine/registration.h @@ -99,7 +99,7 @@ typedef struct _BURN_REGISTRATION BOOL fDisableResume; BOOL fCached; BOOTSTRAPPER_REGISTRATION_TYPE detectedRegistrationType; - LPWSTR sczId; + LPWSTR sczCode; LPWSTR sczTag; LPWSTR *rgsczDetectCodes; @@ -155,8 +155,8 @@ typedef struct _BURN_REGISTRATION BOOL fForwardCompatibleBundleExists; // Only valid after detect. BOOL fEligibleForCleanup; // Only valid after detect. - BOOL fDetectedForeignProviderKeyBundleId; - LPWSTR sczDetectedProviderKeyBundleId; + BOOL fDetectedForeignProviderKeyBundleCode; + LPWSTR sczDetectedProviderKeyBundleCode; LPWSTR sczBundlePackageAncestors; } BURN_REGISTRATION; diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp index 23e0f352..938b24d7 100644 --- a/src/burn/engine/relatedbundle.cpp +++ b/src/burn/engine/relatedbundle.cpp @@ -30,8 +30,8 @@ static HRESULT LoadIfRelatedBundle( __in BURN_RELATED_BUNDLES* pRelatedBundles ); static HRESULT LoadRelatedBundleFromKey( - __in_z LPCWSTR wzRelatedBundleId, - __in HKEY hkBundleId, + __in_z LPCWSTR wzRelatedBundleCode, + __in HKEY hkBundleCode, __in BOOL fPerMachine, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BURN_RELATED_BUNDLE *pRelatedBundle @@ -108,7 +108,7 @@ extern "C" HRESULT RelatedBundleFindById( HRESULT hr = S_OK; BURN_RELATED_BUNDLE* pRelatedBundle = NULL; BURN_PACKAGE* pPackage = NULL; - + *ppRelatedBundle = NULL; for (DWORD i = 0; i < pRelatedBundles->cRelatedBundles; ++i) @@ -180,7 +180,7 @@ static __callback int __cdecl CompareRelatedBundlesDetect( const BURN_RELATED_BUNDLE* pBundleLeft = static_cast(pvLeft); const BURN_RELATED_BUNDLE* pBundleRight = static_cast(pvRight); - // Sort by relation type, then version, then bundle id. + // Sort by relation type, then version, then bundle code. if (pBundleLeft->detectRelationType != pBundleRight->detectRelationType) { // Upgrade bundles last, everything else according to the enum. @@ -223,7 +223,7 @@ static __callback int __cdecl CompareRelatedBundlesPlan( const BURN_RELATED_BUNDLE* pBundleLeft = *reinterpret_cast(const_cast(pvLeft)); const BURN_RELATED_BUNDLE* pBundleRight = *reinterpret_cast(const_cast(pvRight)); - // Sort by relation type, then version, then bundle id. + // Sort by relation type, then version, then bundle code. if (pBundleLeft->planRelationType != pBundleRight->planRelationType) { // Upgrade bundles last, everything else according to the enum. @@ -266,7 +266,7 @@ static BUNDLE_QUERY_CALLBACK_RESULT CALLBACK QueryRelatedBundlesCallback( BUNDLE_QUERY_CONTEXT* pContext = reinterpret_cast(pvContext); hr = LoadIfRelatedBundle(pBundle, pContext->pRegistration, pContext->pRelatedBundles); - ExitOnFailure(hr, "Failed to load related bundle: %ls", pBundle->wzBundleId); + ExitOnFailure(hr, "Failed to load related bundle: %ls", pBundle->wzBundleCode); LExit: return result; @@ -283,8 +283,8 @@ static HRESULT LoadIfRelatedBundle( BOOTSTRAPPER_RELATION_TYPE relationType = RelatedBundleConvertRelationType(pBundle->relationType); BURN_RELATED_BUNDLE* pRelatedBundle = NULL; - // If we found our bundle id, it's not a related bundle. - if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleId, -1, pRegistration->sczId, -1)) + // If we found our bundle code, it's not a related bundle. + if (CSTR_EQUAL == ::CompareStringW(LOCALE_NEUTRAL, NORM_IGNORECASE, pBundle->wzBundleCode, -1, pRegistration->sczCode, -1)) { ExitFunction1(hr = S_FALSE); } @@ -294,8 +294,8 @@ static HRESULT LoadIfRelatedBundle( pRelatedBundle = pRelatedBundles->rgRelatedBundles + pRelatedBundles->cRelatedBundles; - hr = LoadRelatedBundleFromKey(pBundle->wzBundleId, pBundle->hkBundle, fPerMachine, relationType, pRelatedBundle); - ExitOnFailure(hr, "Failed to initialize package from related bundle id: %ls", pBundle->wzBundleId); + hr = LoadRelatedBundleFromKey(pBundle->wzBundleCode, pBundle->hkBundle, fPerMachine, relationType, pRelatedBundle); + ExitOnFailure(hr, "Failed to initialize package from related bundle code: %ls", pBundle->wzBundleCode); hr = DependencyDetectRelatedBundle(pRelatedBundle, pRegistration); ExitOnFailure(hr, "Failed to detect dependencies for related bundle."); @@ -307,8 +307,8 @@ LExit: } static HRESULT LoadRelatedBundleFromKey( - __in_z LPCWSTR wzRelatedBundleId, - __in HKEY hkBundleId, + __in_z LPCWSTR wzRelatedBundleCode, + __in HKEY hkBundleCode, __in BOOL fPerMachine, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BURN_RELATED_BUNDLE* pRelatedBundle @@ -327,7 +327,7 @@ static HRESULT LoadRelatedBundleFromKey( BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL; // Only support progress from engines that are compatible. - hr = RegReadNumber(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion); + hr = RegReadNumber(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_PROTOCOL_VERSION, &dwEngineProtocolVersion); if (SUCCEEDED(hr)) { fSupportsBurnProtocol = BURN_PROTOCOL_VERSION == dwEngineProtocolVersion; @@ -335,7 +335,7 @@ static HRESULT LoadRelatedBundleFromKey( else { // 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) - hr = RegReadVersion(hkBundleId, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion); + hr = RegReadVersion(hkBundleCode, BURN_REGISTRATION_REGISTRY_ENGINE_VERSION, &qwEngineVersion); if (SUCCEEDED(hr)) { fSupportsBurnProtocol = (FILEMAKEVERSION(3, 6, 2221, 0) <= qwEngineVersion && qwEngineVersion <= FILEMAKEVERSION(rmj, rmm, rup, rpr)); @@ -344,19 +344,19 @@ static HRESULT LoadRelatedBundleFromKey( hr = S_OK; } - hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion); - ExitOnFailure(hr, "Failed to read version from registry for bundle: %ls", wzRelatedBundleId); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_VERSION, &sczBundleVersion); + ExitOnFailure(hr, "Failed to read version from registry for bundle: %ls", wzRelatedBundleCode); hr = VerParseVersion(sczBundleVersion, 0, FALSE, &pRelatedBundle->pVersion); ExitOnFailure(hr, "Failed to parse pseudo bundle version: %ls", sczBundleVersion); if (pRelatedBundle->pVersion->fInvalid) { - LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleId, sczBundleVersion); + LogId(REPORT_WARNING, MSG_RELATED_PACKAGE_INVALID_VERSION, wzRelatedBundleCode, sczBundleVersion); } - hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); - ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleId); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_CACHE_PATH, &sczCachePath); + ExitOnFailure(hr, "Failed to read cache path from registry for bundle: %ls", wzRelatedBundleCode); if (FileExistsEx(sczCachePath, NULL)) { @@ -364,13 +364,13 @@ static HRESULT LoadRelatedBundleFromKey( } else { - LogId(REPORT_STANDARD, MSG_DETECT_RELATED_BUNDLE_NOT_CACHED, wzRelatedBundleId, sczCachePath); + LogId(REPORT_STANDARD, MSG_DETECT_RELATED_BUNDLE_NOT_CACHED, wzRelatedBundleCode, sczCachePath); } pRelatedBundle->fPlannable = fCached; - hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); - ExitOnPathFailure(hr, fExists, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleId); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); + ExitOnPathFailure(hr, fExists, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleCode); if (dependencyProvider.sczKey && *dependencyProvider.sczKey) { @@ -379,23 +379,23 @@ static HRESULT LoadRelatedBundleFromKey( dependencyProvider.fImported = TRUE; hr = StrAllocString(&dependencyProvider.sczVersion, pRelatedBundle->pVersion->sczVersion, 0); - ExitOnFailure(hr, "Failed to copy version for bundle: %ls", wzRelatedBundleId); + ExitOnFailure(hr, "Failed to copy version for bundle: %ls", wzRelatedBundleCode); - hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME, &dependencyProvider.sczDisplayName); - ExitOnPathFailure(hr, fExists, "Failed to copy display name for bundle: %ls", wzRelatedBundleId); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME, &dependencyProvider.sczDisplayName); + ExitOnPathFailure(hr, fExists, "Failed to copy display name for bundle: %ls", wzRelatedBundleCode); } - hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_TAG, &pRelatedBundle->sczTag); - ExitOnPathFailure(hr, fExists, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleId); + hr = RegReadString(hkBundleCode, BURN_REGISTRATION_REGISTRY_BUNDLE_TAG, &pRelatedBundle->sczTag); + ExitOnPathFailure(hr, fExists, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleCode); pRelatedBundle->detectRelationType = relationType; - hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleId, + hr = PseudoBundleInitializeRelated(&pRelatedBundle->package, fSupportsBurnProtocol, fPerMachine, wzRelatedBundleCode, #ifdef DEBUG pRelatedBundle->detectRelationType, #endif fCached, sczCachePath, qwFileSize, pBundleDependencyProvider); - ExitOnFailure(hr, "Failed to initialize related bundle to represent bundle: %ls", wzRelatedBundleId); + ExitOnFailure(hr, "Failed to initialize related bundle to represent bundle: %ls", wzRelatedBundleCode); LExit: DependencyUninitializeProvider(&dependencyProvider); diff --git a/src/burn/engine/section.cpp b/src/burn/engine/section.cpp index fd3ce92c..f7c508f3 100644 --- a/src/burn/engine/section.cpp +++ b/src/burn/engine/section.cpp @@ -9,7 +9,7 @@ typedef struct _BURN_SECTION_HEADER DWORD dwMagic; DWORD dwVersion; - GUID guidBundleId; + GUID guidBundleCode; DWORD dwStubSize; DWORD dwOriginalChecksum; @@ -235,7 +235,7 @@ extern "C" HRESULT SectionInitialize( memcpy(pSection->rgcbContainers, pBurnSectionHeader->rgcbContainers, sizeof(DWORD) * pSection->cContainers); // TODO: verify more than just the GUID. - hr = VerifySectionMatchesMemoryPEHeader(pBurnSectionHeader->guidBundleId); + hr = VerifySectionMatchesMemoryPEHeader(pBurnSectionHeader->guidBundleCode); ExitOnRootFailure(hr, "PE Header from file didn't match PE Header in memory."); LExit: @@ -299,7 +299,7 @@ LExit: } HRESULT VerifySectionMatchesMemoryPEHeader( - __in REFGUID pBundleId + __in REFGUID pBundleCode ) { HRESULT hr = S_OK; @@ -382,7 +382,7 @@ HRESULT VerifySectionMatchesMemoryPEHeader( ExitOnRootFailure(hr, "Failed to read section info, unsupported version: %08x", pBurnSectionHeader->dwVersion); } - if (!::IsEqualGUID(pBundleId, pBurnSectionHeader->guidBundleId)) + if (!::IsEqualGUID(pBundleCode, pBurnSectionHeader->guidBundleCode)) { hr = E_INVALIDDATA; ExitOnRootFailure(hr, "Bundle guid didn't match the guid in the PE Header in memory."); diff --git a/src/burn/stub/StubSection.cpp b/src/burn/stub/StubSection.cpp index 62d3e91e..fc3ed182 100644 --- a/src/burn/stub/StubSection.cpp +++ b/src/burn/stub/StubSection.cpp @@ -8,7 +8,7 @@ static DWORD dwMagic = BURN_SECTION_MAGIC; static DWORD dwVersion = BURN_SECTION_VERSION; -static GUID guidBundleId = { }; +static GUID guidBundleCode = { }; static DWORD dwStubSize = 0; static DWORD dwOriginalChecksum = 0; diff --git a/src/burn/test/BurnUnitTest/ManifestTest.cpp b/src/burn/test/BurnUnitTest/ManifestTest.cpp index 87484472..4959cee0 100644 --- a/src/burn/test/BurnUnitTest/ManifestTest.cpp +++ b/src/burn/test/BurnUnitTest/ManifestTest.cpp @@ -40,7 +40,7 @@ namespace Bootstrapper " " " " " " - " " + " " "