Implement fDisableUnloading for the BA.
Sean Hall committed
Apr 29, 2020 at 18:57 UTC
04eff6d8290ea8f3be0c7e8447b73451a2263bb8
4 files changed
+8
-6
src/engine/engine.vcxproj
+2
-2
@@ -2,7 +2,7 @@
2
<!-- 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. -->
3
4
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
5
- <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" />
5
+ <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props')" />
6
<Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" />
7
8
<ItemGroup Label="ProjectConfigurations">
@@ -166,7 +166,7 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command>
166
<PropertyGroup>
167
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
168
</PropertyGroup>
169
- <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.14\build\WixToolset.BootstrapperCore.Native.props'))" />
169
+ <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props'))" />
170
<Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" />
171
<Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" />
172
</Target>
src/engine/packages.config
+1
-1
@@ -1,6 +1,6 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<packages>
3
<package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" />
4
- <package id="WixToolset.BootstrapperCore.Native" version="4.0.14" targetFramework="native" />
4
+ <package id="WixToolset.BootstrapperCore.Native" version="4.0.15" targetFramework="native" />
5
<package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" />
6
</packages>
\ No newline at end of file
src/engine/userexperience.cpp
+4
-3
@@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad(
97
args.pCommand = pCommand;
98
args.pfnBootstrapperEngineProc = EngineForApplicationProc;
99
args.pvBootstrapperEngineProcContext = pEngineContext;
100
- args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 6); // TODO: need to decide whether to keep this, and if so when to update it.
100
+ args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 7); // TODO: need to decide whether to keep this, and if so when to update it.
101
102
results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS);
103
@@ -115,6 +115,7 @@ extern "C" HRESULT UserExperienceLoad(
115
116
pUserExperience->pfnBAProc = results.pfnBootstrapperApplicationProc;
117
pUserExperience->pvBAProcContext = results.pvBootstrapperApplicationProcContext;
118
+ pUserExperience->fDisableUnloading = results.fDisableUnloading;
119
120
LExit:
121
return hr;
@@ -139,8 +140,8 @@ extern "C" HRESULT UserExperienceUnload(
140
pfnDestroy();
141
}
142
142
- // Free BA DLL.
143
- if (!::FreeLibrary(pUserExperience->hUXModule))
143
+ // Free BA DLL if it supports it.
144
+ if (!pUserExperience->fDisableUnloading && !::FreeLibrary(pUserExperience->hUXModule))
145
{
146
hr = HRESULT_FROM_WIN32(::GetLastError());
147
TraceError(hr, "Failed to unload BA DLL.");
src/engine/userexperience.h
+1
@@ -25,6 +25,7 @@ typedef struct _BURN_USER_EXPERIENCE
25
HMODULE hUXModule;
26
PFN_BOOTSTRAPPER_APPLICATION_PROC pfnBAProc;
27
LPVOID pvBAProcContext;
28
+ BOOL fDisableUnloading;
29
LPWSTR sczTempDirectory;
30
31
CRITICAL_SECTION csEngineActive; // Changing the engine active state in the user experience must be