aboutsummaryrefslogtreecommitdiff
path: root/src/mbahost/mbahost.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbahost/mbahost.cpp')
-rw-r--r--src/mbahost/mbahost.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/mbahost/mbahost.cpp b/src/mbahost/mbahost.cpp
index 444a95a8..7916ec9a 100644
--- a/src/mbahost/mbahost.cpp
+++ b/src/mbahost/mbahost.cpp
@@ -1,8 +1,7 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. 1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2 2
3#include "precomp.h" 3#include "precomp.h"
4#include <WixToolset.Mba.Core.h> // includes the generated assembly name macros. 4#include <WixToolset.Mba.Host.h> // includes the generated assembly name macros.
5#include "BalBaseBootstrapperApplicationProc.h"
6 5
7static const DWORD NET452_RELEASE = 379893; 6static const DWORD NET452_RELEASE = 379893;
8 7
@@ -50,7 +49,6 @@ static HRESULT GetCLRHost(
50 ); 49 );
51static HRESULT CreateManagedBootstrapperApplication( 50static HRESULT CreateManagedBootstrapperApplication(
52 __in _AppDomain* pAppDomain, 51 __in _AppDomain* pAppDomain,
53 __in IBootstrapperEngine* pEngine,
54 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, 52 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
55 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults 53 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
56 ); 54 );
@@ -109,7 +107,7 @@ extern "C" HRESULT WINAPI BootstrapperApplicationCreate(
109 { 107 {
110 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading managed bootstrapper application."); 108 BalLog(BOOTSTRAPPER_LOG_LEVEL_STANDARD, "Loading managed bootstrapper application.");
111 109
112 hr = CreateManagedBootstrapperApplication(vpAppDomain, pEngine, pArgs, pResults); 110 hr = CreateManagedBootstrapperApplication(vpAppDomain, pArgs, pResults);
113 BalExitOnFailure(hr, "Failed to create the managed bootstrapper application."); 111 BalExitOnFailure(hr, "Failed to create the managed bootstrapper application.");
114 } 112 }
115 else // fallback to the prerequisite BA. 113 else // fallback to the prerequisite BA.
@@ -185,7 +183,7 @@ static HRESULT GetAppDomain(
185 hr = GetAppBase(&sczAppBase); 183 hr = GetAppBase(&sczAppBase);
186 ExitOnFailure(hr, "Failed to get the host base path."); 184 ExitOnFailure(hr, "Failed to get the host base path.");
187 185
188 hr = PathConcat(sczAppBase, L"WixToolset.Mba.Core.config", &sczConfigPath); 186 hr = PathConcat(sczAppBase, MBA_CONFIG_FILE_NAME, &sczConfigPath);
189 ExitOnFailure(hr, "Failed to get the full path to the application configuration file."); 187 ExitOnFailure(hr, "Failed to get the full path to the application configuration file.");
190 188
191 // Check that the supported framework is installed. 189 // Check that the supported framework is installed.
@@ -514,27 +512,20 @@ LExit:
514// Creates the bootstrapper app and returns it for the engine. 512// Creates the bootstrapper app and returns it for the engine.
515static HRESULT CreateManagedBootstrapperApplication( 513static HRESULT CreateManagedBootstrapperApplication(
516 __in _AppDomain* pAppDomain, 514 __in _AppDomain* pAppDomain,
517 __in IBootstrapperEngine* pEngine,
518 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs, 515 __in const BOOTSTRAPPER_CREATE_ARGS* pArgs,
519 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults 516 __inout BOOTSTRAPPER_CREATE_RESULTS* pResults
520 ) 517 )
521{ 518{
522 HRESULT hr = S_OK; 519 HRESULT hr = S_OK;
523 IBootstrapperApplicationFactory* pAppFactory = NULL; 520 IBootstrapperApplicationFactory* pAppFactory = NULL;
524 IBootstrapperApplication* pApp = NULL;
525 521
526 hr = CreateManagedBootstrapperApplicationFactory(pAppDomain, &pAppFactory); 522 hr = CreateManagedBootstrapperApplicationFactory(pAppDomain, &pAppFactory);
527 ExitOnFailure(hr, "Failed to create the factory to create the bootstrapper application."); 523 ExitOnFailure(hr, "Failed to create the factory to create the bootstrapper application.");
528 524
529 hr = pAppFactory->Create(pEngine, pArgs->pCommand, &pApp); 525 hr = pAppFactory->Create(pArgs, pResults);
530 ExitOnFailure(hr, "Failed to create the bootstrapper application."); 526 ExitOnFailure(hr, "Failed to create the bootstrapper application.");
531 527
532 pResults->pfnBootstrapperApplicationProc = BalBaseBootstrapperApplicationProc;
533 pResults->pvBootstrapperApplicationProcContext = pApp;
534 pApp = NULL;
535
536LExit: 528LExit:
537 ReleaseNullObject(pApp);
538 ReleaseNullObject(pAppFactory); 529 ReleaseNullObject(pAppFactory);
539 530
540 return hr; 531 return hr;
@@ -557,7 +548,7 @@ static HRESULT CreateManagedBootstrapperApplicationFactory(
557 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME); 548 bstrAssemblyName = ::SysAllocString(MBA_ASSEMBLY_FULL_NAME);
558 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory."); 549 ExitOnNull(bstrAssemblyName, hr, E_OUTOFMEMORY, "Failed to allocate the full assembly name for the bootstrapper application factory.");
559 550
560 bstrTypeName = ::SysAllocString(L"WixToolset.Mba.Core.BootstrapperApplicationFactory"); 551 bstrTypeName = ::SysAllocString(MBA_ENTRY_TYPE);
561 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory."); 552 ExitOnNull(bstrTypeName, hr, E_OUTOFMEMORY, "Failed to allocate the full type name for the BA factory.");
562 553
563 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj); 554 hr = pAppDomain->CreateInstance(bstrAssemblyName, bstrTypeName, &pObj);