diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-01-03 14:06:13 -0600 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-01-03 15:49:32 -0600 |
commit | da9e593a5c044cf5430b071dd194b9d94877c4e1 (patch) | |
tree | 76c11883bb4c399d67cc425dfacbda45ec063cfa | |
parent | d5e31dec3a753f98955f3cde3d49a653cfc4aed0 (diff) | |
download | wix-da9e593a5c044cf5430b071dd194b9d94877c4e1.tar.gz wix-da9e593a5c044cf5430b071dd194b9d94877c4e1.tar.bz2 wix-da9e593a5c044cf5430b071dd194b9d94877c4e1.zip |
Fix parsing of DpiAwareness attribute.
4 files changed, 55 insertions, 1 deletions
diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs index 482232c7..40b44bbd 100644 --- a/src/WixToolset.Core/Compiler_Bundle.cs +++ b/src/WixToolset.Core/Compiler_Bundle.cs | |||
@@ -1404,7 +1404,7 @@ namespace WixToolset.Core | |||
1404 | enableSignatureVerification = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 1404 | enableSignatureVerification = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
1405 | break; | 1405 | break; |
1406 | case "DpiAwareness": | 1406 | case "DpiAwareness": |
1407 | if (node.Name.LocalName != "BootstrapperApplication") | 1407 | if (node.Name.LocalName != "BootstrapperApplicationDll") |
1408 | { | 1408 | { |
1409 | this.Core.UnexpectedAttribute(node, attrib); | 1409 | this.Core.UnexpectedAttribute(node, attrib); |
1410 | } | 1410 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs new file mode 100644 index 00000000..9bdc9496 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs | |||
@@ -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 | } | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BootstrapperApplication/DpiAwareness.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BootstrapperApplication/DpiAwareness.wxs new file mode 100644 index 00000000..5b41e807 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BootstrapperApplication/DpiAwareness.wxs | |||
@@ -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> | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj index 595c8a39..b39b5cfb 100644 --- a/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj +++ b/src/test/WixToolsetTest.CoreIntegration/WixToolsetTest.CoreIntegration.csproj | |||
@@ -27,6 +27,7 @@ | |||
27 | <Content Include="TestData\BadInput\UnscheduledRollbackBoundary.wxs" CopyToOutputDirectory="PreserveNewest" /> | 27 | <Content Include="TestData\BadInput\UnscheduledRollbackBoundary.wxs" CopyToOutputDirectory="PreserveNewest" /> |
28 | <Content Include="TestData\BindVariables\DefaultedVariable.wxs" CopyToOutputDirectory="PreserveNewest" /> | 28 | <Content Include="TestData\BindVariables\DefaultedVariable.wxs" CopyToOutputDirectory="PreserveNewest" /> |
29 | <Content Include="TestData\BindVariables\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> | 29 | <Content Include="TestData\BindVariables\data\test.txt" CopyToOutputDirectory="PreserveNewest" /> |
30 | <Content Include="TestData\BootstrapperApplication\DpiAwareness.wxs" CopyToOutputDirectory="PreserveNewest" /> | ||
30 | <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> | 31 | <Content Include="TestData\BundleCustomTable\BundleCustomTable.wxs" CopyToOutputDirectory="PreserveNewest" /> |
31 | <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> | 32 | <Content Include="TestData\BundleExtension\BundleExtension.wxs" CopyToOutputDirectory="PreserveNewest" /> |
32 | <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> | 33 | <Content Include="TestData\BundleExtension\BundleExtensionSearches.wxs" CopyToOutputDirectory="PreserveNewest" /> |