@joebigelow / wix-1 / commits / da9e593a

Fix parsing of DpiAwareness attribute.

Sean Hall committed Jan 3, 2021 at 14:06 UTC da9e593a5c044cf5430b071dd194b9d94877c4e1
4 files changed +55 -1
src/WixToolset.Core/Compiler_Bundle.cs
+1 -1
@@ -1404,7 +1404,7 @@ namespace WixToolset.Core
1404 enableSignatureVerification = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib);
1405 break;
1406 case "DpiAwareness":
1407 - if (node.Name.LocalName != "BootstrapperApplication")
1407 + if (node.Name.LocalName != "BootstrapperApplicationDll")
1408 {
1409 this.Core.UnexpectedAttribute(node, attrib);
1410 }
src/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs new
+46
@@ -0,0 +1,46 @@
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 +
3 +namespace WixToolsetTest.CoreIntegration
4 +{
5 + using System.IO;
6 + using System.Linq;
7 + using WixBuildTools.TestSupport;
8 + using WixToolset.Core.TestPackage;
9 + using WixToolset.Data;
10 + using WixToolset.Data.Symbols;
11 + using Xunit;
12 +
13 + public class BootstrapperApplicationFixture
14 + {
15 + [Fact]
16 + public void CanSetBootstrapperApplicationDllDpiAwareness()
17 + {
18 + var folder = TestData.Get(@"TestData\BootstrapperApplication");
19 +
20 + using (var fs = new DisposableFileSystem())
21 + {
22 + var baseFolder = fs.GetFolder();
23 + var intermediateFolder = Path.Combine(baseFolder, "obj");
24 + var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib");
25 +
26 + var result = WixRunner.Execute(new[]
27 + {
28 + "build",
29 + Path.Combine(folder, "DpiAwareness.wxs"),
30 + "-intermediateFolder", intermediateFolder,
31 + "-o", wixlibPath,
32 + });
33 +
34 + result.AssertSuccess();
35 +
36 + var intermediate = Intermediate.Load(wixlibPath);
37 + var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols);
38 + var baDllSymbol = allSymbols.OfType<WixBootstrapperApplicationDllSymbol>()
39 + .SingleOrDefault();
40 + Assert.NotNull(baDllSymbol);
41 +
42 + Assert.Equal(WixBootstrapperApplicationDpiAwarenessType.GdiScaled, baDllSymbol.DpiAwareness);
43 + }
44 + }
45 + }
46 +}
src/test/WixToolsetTest.CoreIntegration/TestData/BootstrapperApplication/DpiAwareness.wxs new
+7
@@ -0,0 +1,7 @@
1 +<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2 + <Fragment>
3 + <BootstrapperApplication Id="fakeba">
4 + <BootstrapperApplicationDll SourceFile="$(sys.SOURCEFILEPATH)" DpiAwareness="gdiScaled" />
5 + </BootstrapperApplication>
6 + </Fragment>
7 +</Wix>
src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj
+1
@@ -27,6 +27,7 @@
27 <Content Include="TestData\BadInput\UnscheduledRollbackBoundary.wxs" CopyToOutputDirectory="PreserveNewest" />
28 <Content Include="TestData\BindVariables\DefaultedVariable.wxs" CopyToOutputDirectory="PreserveNewest" />
29 <Content Include="TestData\BindVariables\data\test.txt" CopyToOutputDirectory="PreserveNewest" />
30 + <Content Include="TestData\BootstrapperApplication\DpiAwareness.wxs" CopyToOutputDirectory="PreserveNewest" />
31 <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" />
32 <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" />
33 <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" />