aboutsummaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2022-08-08 18:02:15 -0500
committerSean Hall <r.sean.hall@gmail.com>2022-08-09 09:57:02 -0500
commit240b663ad5fc94ed6d19c966b5c9105a176ecf40 (patch)
treed194e242ccb5bb69f0dbbc388ede87cef65c700f /src/ext
parent8e1cbe8d7b468553d76c20452561e89726de5c47 (diff)
downloadwix-240b663ad5fc94ed6d19c966b5c9105a176ecf40.tar.gz
wix-240b663ad5fc94ed6d19c966b5c9105a176ecf40.tar.bz2
wix-240b663ad5fc94ed6d19c966b5c9105a176ecf40.zip
Skip logging errors in some places when they are due to missing files or registry keys or values.
Related to 6696
Diffstat (limited to 'src/ext')
-rw-r--r--src/ext/Bal/dnchost/dncutil.cpp2
-rw-r--r--src/ext/Bal/mbahost/mbahost.cpp99
-rw-r--r--src/ext/Dependency/ca/wixdepca.cpp7
3 files changed, 52 insertions, 56 deletions
diff --git a/src/ext/Bal/dnchost/dncutil.cpp b/src/ext/Bal/dnchost/dncutil.cpp
index 6486e6e9..a8d4f4ff 100644
--- a/src/ext/Bal/dnchost/dncutil.cpp
+++ b/src/ext/Bal/dnchost/dncutil.cpp
@@ -338,7 +338,7 @@ static HRESULT InitializeCoreClrPre5(
338 { 338 {
339 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "%ls: %ls", rgPropertyKeys[i], rgPropertyValues[i]); 339 BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "%ls: %ls", rgPropertyKeys[i], rgPropertyValues[i]);
340 } 340 }
341 BalExitOnFailure(hr = E_FILENOTFOUND, "Failed to locate coreclr.dll."); 341 BalExitWithRootFailure(hr, E_FILENOTFOUND, "Failed to locate coreclr.dll.");
342 } 342 }
343 343
344 hr = LoadCoreClr(pState, sczCoreClrPath); 344 hr = LoadCoreClr(pState, sczCoreClrPath);
diff --git a/src/ext/Bal/mbahost/mbahost.cpp b/src/ext/Bal/mbahost/mbahost.cpp
index 5edbe376..9d8acc8a 100644
--- a/src/ext/Bal/mbahost/mbahost.cpp
+++ b/src/ext/Bal/mbahost/mbahost.cpp
@@ -228,31 +228,31 @@ static HRESULT GetAppDomain(
228 228
229 // Create the setup information for a new AppDomain to set the app base and config. 229 // Create the setup information for a new AppDomain to set the app base and config.
230 hr = pState->pCLRHost->CreateDomainSetup(&pUnk); 230 hr = pState->pCLRHost->CreateDomainSetup(&pUnk);
231 ExitOnRootFailure(hr, "Failed to create the AppDomainSetup object."); 231 BalExitOnRootFailure(hr, "Failed to create the AppDomainSetup object.");
232 232
233 hr = pUnk->QueryInterface(__uuidof(IAppDomainSetup), reinterpret_cast<LPVOID*>(&pAppDomainSetup)); 233 hr = pUnk->QueryInterface(__uuidof(IAppDomainSetup), reinterpret_cast<LPVOID*>(&pAppDomainSetup));
234 ExitOnRootFailure(hr, "Failed to query for the IAppDomainSetup interface."); 234 BalExitOnRootFailure(hr, "Failed to query for the IAppDomainSetup interface.");
235 ReleaseNullObject(pUnk); 235 ReleaseNullObject(pUnk);
236 236
237 // Set properties on the AppDomainSetup object. 237 // Set properties on the AppDomainSetup object.
238 bstrAppBase = ::SysAllocString(pState->sczAppBase); 238 bstrAppBase = ::SysAllocString(pState->sczAppBase);
239 ExitOnNull(bstrAppBase, hr, E_OUTOFMEMORY, "Failed to allocate the application base path for the AppDomainSetup."); 239 BalExitOnNull(bstrAppBase, hr, E_OUTOFMEMORY, "Failed to allocate the application base path for the AppDomainSetup.");
240 240
241 hr = pAppDomainSetup->put_ApplicationBase(bstrAppBase); 241 hr = pAppDomainSetup->put_ApplicationBase(bstrAppBase);
242 ExitOnRootFailure(hr, "Failed to set the application base path for the AppDomainSetup."); 242 BalExitOnRootFailure(hr, "Failed to set the application base path for the AppDomainSetup.");
243 243
244 bstrConfigPath = ::SysAllocString(pState->sczConfigPath); 244 bstrConfigPath = ::SysAllocString(pState->sczConfigPath);
245 ExitOnNull(bstrConfigPath, hr, E_OUTOFMEMORY, "Failed to allocate the application configuration file for the AppDomainSetup."); 245 BalExitOnNull(bstrConfigPath, hr, E_OUTOFMEMORY, "Failed to allocate the application configuration file for the AppDomainSetup.");
246 246
247 hr = pAppDomainSetup->put_ConfigurationFile(bstrConfigPath); 247 hr = pAppDomainSetup->put_ConfigurationFile(bstrConfigPath);
248 ExitOnRootFailure(hr, "Failed to set the configuration file path for the AppDomainSetup."); 248 BalExitOnRootFailure(hr, "Failed to set the configuration file path for the AppDomainSetup.");
249 249
250 // Create the AppDomain to load the factory type. 250 // Create the AppDomain to load the factory type.
251 hr = pState->pCLRHost->CreateDomainEx(L"MBA", pAppDomainSetup, NULL, &pUnk); 251 hr = pState->pCLRHost->CreateDomainEx(L"MBA", pAppDomainSetup, NULL, &pUnk);
252 ExitOnRootFailure(hr, "Failed to create the MBA AppDomain."); 252 BalExitOnRootFailure(hr, "Failed to create the MBA AppDomain.");
253 253
254 hr = pUnk->QueryInterface(__uuidof(_AppDomain), reinterpret_cast<LPVOID*>(&pState->pAppDomain)); 254 hr = pUnk->QueryInterface(__uuidof(_AppDomain), reinterpret_cast<LPVOID*>(&pState->pAppDomain));
255 ExitOnRootFailure(hr, "Failed to query for the _AppDomain interface."); 255 BalExitOnRootFailure(hr, "Failed to query for the _AppDomain interface.");
256 256
257LExit: 257LExit:
258 ReleaseBSTR(bstrConfigPath); 258 ReleaseBSTR(bstrConfigPath);
@@ -270,13 +270,13 @@ static HRESULT LoadModulePaths(
270 LPWSTR sczFullPath = NULL; 270 LPWSTR sczFullPath = NULL;
271 271
272 hr = PathForCurrentProcess(&sczFullPath, pState->hInstance); 272 hr = PathForCurrentProcess(&sczFullPath, pState->hInstance);
273 ExitOnFailure(hr, "Failed to get the full host path."); 273 BalExitOnFailure(hr, "Failed to get the full host path.");
274 274
275 hr = PathGetDirectory(sczFullPath, &pState->sczAppBase); 275 hr = PathGetDirectory(sczFullPath, &pState->sczAppBase);
276 ExitOnFailure(hr, "Failed to get the directory of the full process path."); 276 BalExitOnFailure(hr, "Failed to get the directory of the full process path.");
277 277
278 hr = PathConcat(pState->sczAppBase, MBA_CONFIG_FILE_NAME, &pState->sczConfigPath); 278 hr = PathConcat(pState->sczAppBase, MBA_CONFIG_FILE_NAME, &pState->sczConfigPath);
279 ExitOnFailure(hr, "Failed to get the full path to the application configuration file."); 279 BalExitOnFailure(hr, "Failed to get the full path to the application configuration file.");
280 280
281LExit: 281LExit:
282 ReleaseStr(sczFullPath); 282 ReleaseStr(sczFullPath);
@@ -332,23 +332,23 @@ static HRESULT CheckSupportedFrameworks(
332 BOOL fUpdatedManifest = FALSE; 332 BOOL fUpdatedManifest = FALSE;
333 333
334 hr = XmlLoadDocumentFromFile(wzConfigPath, &pixdManifest); 334 hr = XmlLoadDocumentFromFile(wzConfigPath, &pixdManifest);
335 ExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", wzConfigPath); 335 BalExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", wzConfigPath);
336 336
337 hr = XmlSelectNodes(pixdManifest, L"/configuration/wix.bootstrapper/host/supportedFramework", &pNodeList); 337 hr = XmlSelectNodes(pixdManifest, L"/configuration/wix.bootstrapper/host/supportedFramework", &pNodeList);
338 ExitOnFailure(hr, "Failed to select all supportedFramework elements."); 338 BalExitOnFailure(hr, "Failed to select all supportedFramework elements.");
339 339
340 hr = pNodeList->get_length(reinterpret_cast<long*>(&cSupportedFrameworks)); 340 hr = pNodeList->get_length(reinterpret_cast<long*>(&cSupportedFrameworks));
341 ExitOnFailure(hr, "Failed to get the supported framework count."); 341 BalExitOnFailure(hr, "Failed to get the supported framework count.");
342 342
343 if (cSupportedFrameworks) 343 if (cSupportedFrameworks)
344 { 344 {
345 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL))) 345 while (S_OK == (hr = XmlNextElement(pNodeList, &pNode, NULL)))
346 { 346 {
347 hr = XmlGetAttributeEx(pNode, L"version", &sczSupportedFrameworkVersion); 347 hr = XmlGetAttributeEx(pNode, L"version", &sczSupportedFrameworkVersion);
348 ExitOnRequiredXmlQueryFailure(hr, "Failed to get supportedFramework/@version."); 348 BalExitOnRequiredXmlQueryFailure(hr, "Failed to get supportedFramework/@version.");
349 349
350 hr = StrAllocFormatted(&sczFrameworkRegistryKey, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\%ls", sczSupportedFrameworkVersion); 350 hr = StrAllocFormatted(&sczFrameworkRegistryKey, L"SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\%ls", sczSupportedFrameworkVersion);
351 ExitOnFailure(hr, "Failed to allocate path to supported framework Install registry key."); 351 BalExitOnFailure(hr, "Failed to allocate path to supported framework Install registry key.");
352 352
353 hr = RegOpen(HKEY_LOCAL_MACHINE, sczFrameworkRegistryKey, KEY_READ, &hkFramework); 353 hr = RegOpen(HKEY_LOCAL_MACHINE, sczFrameworkRegistryKey, KEY_READ, &hkFramework);
354 if (SUCCEEDED(hr)) 354 if (SUCCEEDED(hr))
@@ -367,19 +367,18 @@ static HRESULT CheckSupportedFrameworks(
367 // If we looped through all the supported frameworks but didn't find anything, ensure we return a failure. 367 // If we looped through all the supported frameworks but didn't find anything, ensure we return a failure.
368 if (S_FALSE == hr) 368 if (S_FALSE == hr)
369 { 369 {
370 hr = E_NOTFOUND; 370 BalExitWithRootFailure(hr, E_NOTFOUND, "Failed to find a supported framework.");
371 ExitOnRootFailure(hr, "Failed to find a supported framework.");
372 } 371 }
373 372
374 hr = UpdateSupportedRuntime(pixdManifest, pNode, &fUpdatedManifest); 373 hr = UpdateSupportedRuntime(pixdManifest, pNode, &fUpdatedManifest);
375 ExitOnFailure(hr, "Failed to update supportedRuntime."); 374 BalExitOnFailure(hr, "Failed to update supportedRuntime.");
376 } 375 }
377 // else no supported frameworks specified, so the startup/supportedRuntime must be enough. 376 // else no supported frameworks specified, so the startup/supportedRuntime must be enough.
378 377
379 if (fUpdatedManifest) 378 if (fUpdatedManifest)
380 { 379 {
381 hr = XmlSaveDocument(pixdManifest, wzConfigPath); 380 hr = XmlSaveDocument(pixdManifest, wzConfigPath);
382 ExitOnFailure(hr, "Failed to save updated manifest over config file: %ls", wzConfigPath); 381 BalExitOnFailure(hr, "Failed to save updated manifest over config file: %ls", wzConfigPath);
383 } 382 }
384 383
385LExit: 384LExit:
@@ -410,7 +409,7 @@ static HRESULT UpdateSupportedRuntime(
410 409
411 // If the runtime version attribute is not specified, don't update the manifest. 410 // If the runtime version attribute is not specified, don't update the manifest.
412 hr = XmlGetAttributeEx(pixnSupportedFramework, L"runtimeVersion", &sczSupportedRuntimeVersion); 411 hr = XmlGetAttributeEx(pixnSupportedFramework, L"runtimeVersion", &sczSupportedRuntimeVersion);
413 ExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get supportedFramework/@runtimeVersion."); 412 BalExitOnOptionalXmlQueryFailure(hr, fXmlFound, "Failed to get supportedFramework/@runtimeVersion.");
414 413
415 if (!fXmlFound) 414 if (!fXmlFound)
416 { 415 {
@@ -420,17 +419,17 @@ static HRESULT UpdateSupportedRuntime(
420 // Get the startup element. Fail if we can't find it since it'll be necessary to load the 419 // Get the startup element. Fail if we can't find it since it'll be necessary to load the
421 // correct runtime. 420 // correct runtime.
422 hr = XmlSelectSingleNode(pixdManifest, L"/configuration/startup", &pixnStartup); 421 hr = XmlSelectSingleNode(pixdManifest, L"/configuration/startup", &pixnStartup);
423 ExitOnRequiredXmlQueryFailure(hr, "Failed to get startup element."); 422 BalExitOnRequiredXmlQueryFailure(hr, "Failed to get startup element.");
424 423
425 // Remove any pre-existing supported runtimes because they'll just get in the way and create our new one. 424 // Remove any pre-existing supported runtimes because they'll just get in the way and create our new one.
426 hr = XmlRemoveChildren(pixnStartup, L"supportedRuntime"); 425 hr = XmlRemoveChildren(pixnStartup, L"supportedRuntime");
427 ExitOnFailure(hr, "Failed to remove pre-existing supportedRuntime elements."); 426 BalExitOnFailure(hr, "Failed to remove pre-existing supportedRuntime elements.");
428 427
429 hr = XmlCreateChild(pixnStartup, L"supportedRuntime", &pixnSupportedRuntime); 428 hr = XmlCreateChild(pixnStartup, L"supportedRuntime", &pixnSupportedRuntime);
430 ExitOnFailure(hr, "Failed to create supportedRuntime element."); 429 BalExitOnFailure(hr, "Failed to create supportedRuntime element.");
431 430
432 hr = XmlSetAttribute(pixnSupportedRuntime, L"version", sczSupportedRuntimeVersion); 431 hr = XmlSetAttribute(pixnSupportedRuntime, L"version", sczSupportedRuntimeVersion);
433 ExitOnFailure(hr, "Failed to set supportedRuntime/@version to '%ls'.", sczSupportedRuntimeVersion); 432 BalExitOnFailure(hr, "Failed to set supportedRuntime/@version to '%ls'.", sczSupportedRuntimeVersion);
434 433
435 *pfUpdatedManifest = TRUE; 434 *pfUpdatedManifest = TRUE;
436 435
@@ -465,14 +464,14 @@ static HRESULT LoadRuntime(
465 464
466 // Check that the supported framework is installed. 465 // Check that the supported framework is installed.
467 hr = CheckSupportedFrameworks(pState->sczConfigPath); 466 hr = CheckSupportedFrameworks(pState->sczConfigPath);
468 ExitOnFailure(hr, "Failed to find supported framework."); 467 BalExitOnFailure(hr, "Failed to find supported framework.");
469 468
470 // Cache the CLR host to be shutdown later. This can occur on a different thread. 469 // Cache the CLR host to be shutdown later. This can occur on a different thread.
471 // Disable message boxes from being displayed on error and blocking execution. 470 // Disable message boxes from being displayed on error and blocking execution.
472 ::SetErrorMode(uiMode | SEM_FAILCRITICALERRORS); 471 ::SetErrorMode(uiMode | SEM_FAILCRITICALERRORS);
473 472
474 hr = LoadSystemLibrary(L"mscoree.dll", &hModule); 473 hr = LoadSystemLibrary(L"mscoree.dll", &hModule);
475 ExitOnFailure(hr, "Failed to load mscoree.dll"); 474 BalExitOnFailure(hr, "Failed to load mscoree.dll");
476 475
477 pfnCLRCreateInstance = reinterpret_cast<CLRCreateInstanceFnPtr>(::GetProcAddress(hModule, "CLRCreateInstance")); 476 pfnCLRCreateInstance = reinterpret_cast<CLRCreateInstanceFnPtr>(::GetProcAddress(hModule, "CLRCreateInstance"));
478 477
@@ -481,7 +480,7 @@ static HRESULT LoadRuntime(
481 hr = pfnCLRCreateInstance(CLSID_CLRMetaHostPolicy, IID_ICLRMetaHostPolicy, reinterpret_cast<LPVOID*>(&pCLRMetaHostPolicy)); 480 hr = pfnCLRCreateInstance(CLSID_CLRMetaHostPolicy, IID_ICLRMetaHostPolicy, reinterpret_cast<LPVOID*>(&pCLRMetaHostPolicy));
482 if (E_NOTIMPL != hr) 481 if (E_NOTIMPL != hr)
483 { 482 {
484 ExitOnRootFailure(hr, "Failed to create instance of ICLRMetaHostPolicy."); 483 BalExitOnRootFailure(hr, "Failed to create instance of ICLRMetaHostPolicy.");
485 484
486 fFallbackToCorBindToCurrentRuntime = FALSE; 485 fFallbackToCorBindToCurrentRuntime = FALSE;
487 } 486 }
@@ -490,19 +489,19 @@ static HRESULT LoadRuntime(
490 if (fFallbackToCorBindToCurrentRuntime) 489 if (fFallbackToCorBindToCurrentRuntime)
491 { 490 {
492 pfnCorBindToCurrentRuntime = reinterpret_cast<PFN_CORBINDTOCURRENTRUNTIME>(::GetProcAddress(hModule, "CorBindToCurrentRuntime")); 491 pfnCorBindToCurrentRuntime = reinterpret_cast<PFN_CORBINDTOCURRENTRUNTIME>(::GetProcAddress(hModule, "CorBindToCurrentRuntime"));
493 ExitOnNullWithLastError(pfnCorBindToCurrentRuntime, hr, "Failed to get procedure address for CorBindToCurrentRuntime."); 492 BalExitOnNullWithLastError(pfnCorBindToCurrentRuntime, hr, "Failed to get procedure address for CorBindToCurrentRuntime.");
494 493
495 hr = pfnCorBindToCurrentRuntime(pState->sczConfigPath, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&pState->pCLRHost)); 494 hr = pfnCorBindToCurrentRuntime(pState->sczConfigPath, CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&pState->pCLRHost));
496 ExitOnRootFailure(hr, "Failed to create the CLR host using the application configuration file path."); 495 BalExitOnRootFailure(hr, "Failed to create the CLR host using the application configuration file path.");
497 } 496 }
498 else 497 else
499 { 498 {
500 499
501 hr = SHCreateStreamOnFileEx(pState->sczConfigPath, STGM_READ | STGM_SHARE_DENY_WRITE, 0, FALSE, NULL, &pCfgStream); 500 hr = SHCreateStreamOnFileEx(pState->sczConfigPath, STGM_READ | STGM_SHARE_DENY_WRITE, 0, FALSE, NULL, &pCfgStream);
502 ExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", pState->sczConfigPath); 501 BalExitOnFailure(hr, "Failed to load bootstrapper config file from path: %ls", pState->sczConfigPath);
503 502
504 hr = pCLRMetaHostPolicy->GetRequestedRuntime(METAHOST_POLICY_HIGHCOMPAT, NULL, pCfgStream, NULL, &cchVersion, NULL, NULL, &dwConfigFlags, IID_ICLRRuntimeInfo, reinterpret_cast<LPVOID*>(&pCLRRuntimeInfo)); 503 hr = pCLRMetaHostPolicy->GetRequestedRuntime(METAHOST_POLICY_HIGHCOMPAT, NULL, pCfgStream, NULL, &cchVersion, NULL, NULL, &dwConfigFlags, IID_ICLRRuntimeInfo, reinterpret_cast<LPVOID*>(&pCLRRuntimeInfo));
505 ExitOnRootFailure(hr, "Failed to get the CLR runtime info using the application configuration file path."); 504 BalExitOnRootFailure(hr, "Failed to get the CLR runtime info using the application configuration file path.");
506 505
507 // .NET 4 RTM had a bug where it wouldn't set pcchVersion if pwzVersion was NULL. 506 // .NET 4 RTM had a bug where it wouldn't set pcchVersion if pwzVersion was NULL.
508 if (!cchVersion) 507 if (!cchVersion)
@@ -510,7 +509,7 @@ static HRESULT LoadRuntime(
510 hr = pCLRRuntimeInfo->GetVersionString(NULL, &cchVersion); 509 hr = pCLRRuntimeInfo->GetVersionString(NULL, &cchVersion);
511 if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) != hr) 510 if (HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) != hr)
512 { 511 {
513 ExitOnFailure(hr, "Failed to get the length of the CLR version string."); 512 BalExitOnFailure(hr, "Failed to get the length of the CLR version string.");
514 } 513 }
515 } 514 }
516 515
@@ -523,21 +522,21 @@ static HRESULT LoadRuntime(
523 if (CSTR_EQUAL == CompareString(LOCALE_NEUTRAL, 0, L"v4.0.30319", -1, pwzVersion, cchVersion)) 522 if (CSTR_EQUAL == CompareString(LOCALE_NEUTRAL, 0, L"v4.0.30319", -1, pwzVersion, cchVersion))
524 { 523 {
525 hr = VerifyNET4RuntimeIsSupported(); 524 hr = VerifyNET4RuntimeIsSupported();
526 ExitOnFailure(hr, "Found unsupported .NET 4 Runtime."); 525 BalExitOnFailure(hr, "Found unsupported .NET 4 Runtime.");
527 } 526 }
528 527
529 if (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_TRUE == (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_MASK & dwConfigFlags)) 528 if (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_TRUE == (METAHOST_CONFIG_FLAGS_LEGACY_V2_ACTIVATION_POLICY_MASK & dwConfigFlags))
530 { 529 {
531 hr = pCLRRuntimeInfo->BindAsLegacyV2Runtime(); 530 hr = pCLRRuntimeInfo->BindAsLegacyV2Runtime();
532 ExitOnRootFailure(hr, "Failed to bind as legacy V2 runtime."); 531 BalExitOnRootFailure(hr, "Failed to bind as legacy V2 runtime.");
533 } 532 }
534 533
535 hr = pCLRRuntimeInfo->GetInterface(CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&pState->pCLRHost)); 534 hr = pCLRRuntimeInfo->GetInterface(CLSID_CorRuntimeHost, IID_ICorRuntimeHost, reinterpret_cast<LPVOID*>(&pState->pCLRHost));
536 ExitOnRootFailure(hr, "Failed to get instance of ICorRuntimeHost."); 535 BalExitOnRootFailure(hr, "Failed to get instance of ICorRuntimeHost.");
537 } 536 }
538 537
539 hr = pState->pCLRHost->Start(); 538 hr = pState->pCLRHost->Start();
540 ExitOnRootFailure(hr, "Failed to start the CLR host."); 539 BalExitOnRootFailure(hr, "Failed to start the CLR host.");
541 540
542LExit: 541LExit:
543 ReleaseStr(pwzVersion); 542 ReleaseStr(pwzVersion);
@@ -567,10 +566,10 @@ static HRESULT CreateManagedBootstrapperApplication(
567 IBootstrapperApplicationFactory* pAppFactory = NULL; 566 IBootstrapperApplicationFactory* pAppFactory = NULL;
568 567
569 hr = CreateManagedBootstrapperApplicationFactory(pAppDomain, &pAppFactory); 568 hr = CreateManagedBootstrapperApplicationFactory(pAppDomain, &pAppFactory);
570 ExitOnFailure(hr, "Failed to create the factory to create the bootstrapper application."); 569 BalExitOnFailure(hr, "Failed to create the factory to create the bootstrapper application.");
571 570
572 hr = pAppFactory->Create(pArgs, pResults); 571 hr = pAppFactory->Create(pArgs, pResults);
573 ExitOnFailure(hr, "Failed to create the bootstrapper application."); 572 BalExitOnFailure(hr, "Failed to create the bootstrapper application.");
574 573
575LExit: 574LExit:
576 ReleaseNullObject(pAppFactory); 575 ReleaseNullObject(pAppFactory);
@@ -593,20 +592,20 @@ static HRESULT CreateManagedBootstrapperApplicationFactory(
593 ::VariantInit(&vtBAFactory); 592 ::VariantInit(&vtBAFactory);
594 593
595 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME); 594 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME);
596 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory."); 595 BalExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory.");
597 596
598 bstrTypeName = ::SysAllocString(MBA_ENTRY_TYPE); 597 bstrTypeName = ::SysAllocString(MBA_ENTRY_TYPE);
599 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory."); 598 BalExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory.");
600 599
601 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj); 600 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj);
602 ExitOnRootFailure(hr, "Failed to create the BA factory object."); 601 BalExitOnRootFailure(hr, "Failed to create the BA factory object.");
603 602
604 hr = pObj->Unwrap(&vtBAFactory); 603 hr = pObj->Unwrap(&vtBAFactory);
605 ExitOnRootFailure(hr, "Failed to unwrap the BA factory object into the host domain."); 604 BalExitOnRootFailure(hr, "Failed to unwrap the BA factory object into the host domain.");
606 ExitOnNull(vtBAFactory.punkVal, hr, E_UNEXPECTED, "The variant did not contain the expected IUnknown pointer."); 605 BalExitOnNull(vtBAFactory.punkVal, hr, E_UNEXPECTED, "The variant did not contain the expected IUnknown pointer.");
607 606
608 hr = vtBAFactory.punkVal->QueryInterface(__uuidof(IBootstrapperApplicationFactory), reinterpret_cast<LPVOID*>(ppAppFactory)); 607 hr = vtBAFactory.punkVal->QueryInterface(__uuidof(IBootstrapperApplicationFactory), reinterpret_cast<LPVOID*>(ppAppFactory));
609 ExitOnRootFailure(hr, "Failed to query for the bootstrapper app factory interface."); 608 BalExitOnRootFailure(hr, "Failed to query for the bootstrapper app factory interface.");
610 609
611LExit: 610LExit:
612 ReleaseVariant(vtBAFactory); 611 ReleaseVariant(vtBAFactory);
@@ -632,13 +631,13 @@ static HRESULT CreatePrerequisiteBA(
632 BalExitOnFailure(hr, "Failed to get path to pre-requisite BA."); 631 BalExitOnFailure(hr, "Failed to get path to pre-requisite BA.");
633 632
634 hModule = ::LoadLibraryExW(sczMbapreqPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); 633 hModule = ::LoadLibraryExW(sczMbapreqPath, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
635 ExitOnNullWithLastError(hModule, hr, "Failed to load pre-requisite BA DLL."); 634 BalExitOnNullWithLastError(hModule, hr, "Failed to load pre-requisite BA DLL.");
636 635
637 PFN_PREQ_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = reinterpret_cast<PFN_PREQ_BOOTSTRAPPER_APPLICATION_CREATE>(::GetProcAddress(hModule, "PrereqBootstrapperApplicationCreate")); 636 PFN_PREQ_BOOTSTRAPPER_APPLICATION_CREATE pfnCreate = reinterpret_cast<PFN_PREQ_BOOTSTRAPPER_APPLICATION_CREATE>(::GetProcAddress(hModule, "PrereqBootstrapperApplicationCreate"));
638 ExitOnNullWithLastError(pfnCreate, hr, "Failed to get PrereqBootstrapperApplicationCreate entry-point from: %ls", sczMbapreqPath); 637 BalExitOnNullWithLastError(pfnCreate, hr, "Failed to get PrereqBootstrapperApplicationCreate entry-point from: %ls", sczMbapreqPath);
639 638
640 hr = pfnCreate(&pState->prereqData, pEngine, pArgs, pResults); 639 hr = pfnCreate(&pState->prereqData, pEngine, pArgs, pResults);
641 ExitOnFailure(hr, "Failed to create prequisite bootstrapper app."); 640 BalExitOnFailure(hr, "Failed to create prequisite bootstrapper app.");
642 641
643 pState->hMbapreqModule = hModule; 642 pState->hMbapreqModule = hModule;
644 hModule = NULL; 643 hModule = NULL;
@@ -672,14 +671,14 @@ static HRESULT VerifyNET4RuntimeIsSupported(
672 { 671 {
673 ExitFunction1(hr = S_OK); 672 ExitFunction1(hr = S_OK);
674 } 673 }
675 ExitOnFailure(hr, "Failed to open registry key for .NET 4."); 674 BalExitOnFailure(hr, "Failed to open registry key for .NET 4.");
676 675
677 er = ::RegQueryValueExW(hKey, L"Release", NULL, NULL, reinterpret_cast<LPBYTE>(&dwRelease), &cchRelease); 676 er = ::RegQueryValueExW(hKey, L"Release", NULL, NULL, reinterpret_cast<LPBYTE>(&dwRelease), &cchRelease);
678 if (ERROR_FILE_NOT_FOUND == er) 677 if (ERROR_FILE_NOT_FOUND == er)
679 { 678 {
680 ExitFunction1(hr = S_OK); 679 ExitFunction1(hr = S_OK);
681 } 680 }
682 ExitOnWin32Error(er, hr, "Failed to get Release value."); 681 BalExitOnWin32Error(er, hr, "Failed to get Release value.");
683 682
684 if (NET452_RELEASE <= dwRelease) 683 if (NET452_RELEASE <= dwRelease)
685 { 684 {
diff --git a/src/ext/Dependency/ca/wixdepca.cpp b/src/ext/Dependency/ca/wixdepca.cpp
index e9278e04..87610420 100644
--- a/src/ext/Dependency/ca/wixdepca.cpp
+++ b/src/ext/Dependency/ca/wixdepca.cpp
@@ -277,6 +277,7 @@ static HRESULT EnsureAbsentDependents(
277 DEPENDENCY* rgDependents = NULL; 277 DEPENDENCY* rgDependents = NULL;
278 UINT cDependents = 0; 278 UINT cDependents = 0;
279 PMSIHANDLE hDependencyRec = NULL; 279 PMSIHANDLE hDependencyRec = NULL;
280 BOOL fExists = FALSE;
280 281
281 // Skip the dependent check if the Wix4DependencyProvider table is missing (no dependency providers). 282 // Skip the dependent check if the Wix4DependencyProvider table is missing (no dependency providers).
282 hr = WcaTableExists(L"Wix4DependencyProvider"); 283 hr = WcaTableExists(L"Wix4DependencyProvider");
@@ -338,11 +339,7 @@ static HRESULT EnsureAbsentDependents(
338 339
339 // Check the registry to see if the provider has any dependents registered. 340 // Check the registry to see if the provider has any dependents registered.
340 hr = DepCheckDependents(hkHive, sczProviderKey, iAttributes, sdIgnoredDependents, &rgDependents, &cDependents); 341 hr = DepCheckDependents(hkHive, sczProviderKey, iAttributes, sdIgnoredDependents, &rgDependents, &cDependents);
341 if (E_FILENOTFOUND == hr) 342 ExitOnPathFailure(hr, fExists, "Failed dependents check for %ls.", sczId);
342 {
343 hr = S_OK;
344 }
345 ExitOnFailure(hr, "Failed dependents check for %ls.", sczId);
346 } 343 }
347 344
348 if (E_NOMOREITEMS != hr) 345 if (E_NOMOREITEMS != hr)