From da9e593a5c044cf5430b071dd194b9d94877c4e1 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Sun, 3 Jan 2021 14:06:13 -0600 Subject: Fix parsing of DpiAwareness attribute. --- .../BootstrapperApplicationFixture.cs | 46 ++++++++++++++++++++++ .../BootstrapperApplication/DpiAwareness.wxs | 7 ++++ .../WixToolsetTest.CoreIntegration.csproj | 1 + 3 files changed, 54 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/BootstrapperApplicationFixture.cs create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/BootstrapperApplication/DpiAwareness.wxs (limited to 'src/test') 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 @@ +// 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. + +namespace WixToolsetTest.CoreIntegration +{ + using System.IO; + using System.Linq; + using WixBuildTools.TestSupport; + using WixToolset.Core.TestPackage; + using WixToolset.Data; + using WixToolset.Data.Symbols; + using Xunit; + + public class BootstrapperApplicationFixture + { + [Fact] + public void CanSetBootstrapperApplicationDllDpiAwareness() + { + var folder = TestData.Get(@"TestData\BootstrapperApplication"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var wixlibPath = Path.Combine(intermediateFolder, @"test.wixlib"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "DpiAwareness.wxs"), + "-intermediateFolder", intermediateFolder, + "-o", wixlibPath, + }); + + result.AssertSuccess(); + + var intermediate = Intermediate.Load(wixlibPath); + var allSymbols = intermediate.Sections.SelectMany(s => s.Symbols); + var baDllSymbol = allSymbols.OfType() + .SingleOrDefault(); + Assert.NotNull(baDllSymbol); + + Assert.Equal(WixBootstrapperApplicationDpiAwarenessType.GdiScaled, baDllSymbol.DpiAwareness); + } + } + } +} 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 @@ + + + + + + + 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 @@ + -- cgit v1.2.3-55-g6feb