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/libs/dutil/WixToolset.DUtil/wiutil.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/libs/dutil/WixToolset.DUtil/wiutil.cpp') diff --git a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp index da7cffe7..5f81cf3a 100644 --- a/src/libs/dutil/WixToolset.DUtil/wiutil.cpp +++ b/src/libs/dutil/WixToolset.DUtil/wiutil.cpp @@ -427,6 +427,11 @@ extern "C" HRESULT DAPI WiuGetProductInfo( er = vpfnMsiGetProductInfoW(wzProductCode, wzProperty, *psczValue, &cch); } + + if (ERROR_UNKNOWN_PRODUCT == er || ERROR_UNKNOWN_PROPERTY == er) + { + ExitFunction1(hr = HRESULT_FROM_WIN32(er)); + } WiuExitOnWin32Error(er, hr, "Failed to get product info."); LExit: @@ -449,7 +454,10 @@ extern "C" HRESULT DAPI WiuGetProductInfoEx( if (!vpfnMsiGetProductInfoExW) { hr = WiuGetProductInfo(wzProductCode, wzProperty, psczValue); - WiuExitOnFailure(hr, "Failed to get product info when extended info was not available."); + if (HRESULT_FROM_WIN32(ERROR_UNKNOWN_PRODUCT) != hr && HRESULT_FROM_WIN32(ERROR_UNKNOWN_PROPERTY) != hr) + { + WiuExitOnFailure(hr, "Failed to get product info when extended info was not available."); + } ExitFunction(); } @@ -466,6 +474,11 @@ extern "C" HRESULT DAPI WiuGetProductInfoEx( er = vpfnMsiGetProductInfoExW(wzProductCode, wzUserSid, dwContext, wzProperty, *psczValue, &cch); } + + if (ERROR_UNKNOWN_PRODUCT == er || ERROR_UNKNOWN_PROPERTY == er) + { + ExitFunction1(hr = HRESULT_FROM_WIN32(er)); + } WiuExitOnWin32Error(er, hr, "Failed to get extended product info."); LExit: -- cgit v1.2.3-55-g6feb