From 240b663ad5fc94ed6d19c966b5c9105a176ecf40 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Mon, 8 Aug 2022 18:02:15 -0500 Subject: Skip logging errors in some places when they are due to missing files or registry keys or values. Related to 6696 --- src/burn/engine/relatedbundle.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/burn/engine/relatedbundle.cpp') diff --git a/src/burn/engine/relatedbundle.cpp b/src/burn/engine/relatedbundle.cpp index 586446b1..23e0f352 100644 --- a/src/burn/engine/relatedbundle.cpp +++ b/src/burn/engine/relatedbundle.cpp @@ -322,6 +322,7 @@ static HRESULT LoadRelatedBundleFromKey( LPWSTR sczCachePath = NULL; BOOL fCached = FALSE; DWORD64 qwFileSize = 0; + BOOL fExists = FALSE; BURN_DEPENDENCY_PROVIDER dependencyProvider = { }; BURN_DEPENDENCY_PROVIDER* pBundleDependencyProvider = NULL; @@ -369,10 +370,7 @@ static HRESULT LoadRelatedBundleFromKey( pRelatedBundle->fPlannable = fCached; hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_PROVIDER_KEY, &dependencyProvider.sczKey); - if (E_FILENOTFOUND != hr) - { - ExitOnFailure(hr, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleId); - } + ExitOnPathFailure(hr, fExists, "Failed to read provider key from registry for bundle: %ls", wzRelatedBundleId); if (dependencyProvider.sczKey && *dependencyProvider.sczKey) { @@ -384,18 +382,11 @@ static HRESULT LoadRelatedBundleFromKey( ExitOnFailure(hr, "Failed to copy version for bundle: %ls", wzRelatedBundleId); hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_DISPLAY_NAME, &dependencyProvider.sczDisplayName); - if (E_FILENOTFOUND != hr) - { - ExitOnFailure(hr, "Failed to copy display name for bundle: %ls", wzRelatedBundleId); - } + ExitOnPathFailure(hr, fExists, "Failed to copy display name for bundle: %ls", wzRelatedBundleId); } hr = RegReadString(hkBundleId, BURN_REGISTRATION_REGISTRY_BUNDLE_TAG, &pRelatedBundle->sczTag); - if (E_FILENOTFOUND == hr) - { - hr = S_OK; - } - ExitOnFailure(hr, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleId); + ExitOnPathFailure(hr, fExists, "Failed to read tag from registry for bundle: %ls", wzRelatedBundleId); pRelatedBundle->detectRelationType = relationType; -- cgit v1.2.3-55-g6feb