diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2020-07-19 16:19:17 +1000 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2020-07-19 19:19:36 +1000 |
| commit | 414c07f7adce9c9fd0132ab0fade0267f743f665 (patch) | |
| tree | b2c207fa0b8363e41b11e843db55cea97456bf80 /src/WixToolset.Core/Compiler_Bundle.cs | |
| parent | 2a87b3e728fb56202d21d402cecc0bceeac49ade (diff) | |
| download | wix-414c07f7adce9c9fd0132ab0fade0267f743f665.tar.gz wix-414c07f7adce9c9fd0132ab0fade0267f743f665.tar.bz2 wix-414c07f7adce9c9fd0132ab0fade0267f743f665.zip | |
WIXFEAT:6204 Use the new DpiAwareness attribute on BootstrapperApplication element to control the DPI awareness settings in the bundle's application manifest.
Diffstat (limited to 'src/WixToolset.Core/Compiler_Bundle.cs')
| -rw-r--r-- | src/WixToolset.Core/Compiler_Bundle.cs | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs index 7cdb8ca0..d73db84d 100644 --- a/src/WixToolset.Core/Compiler_Bundle.cs +++ b/src/WixToolset.Core/Compiler_Bundle.cs | |||
| @@ -649,6 +649,7 @@ namespace WixToolset.Core | |||
| 649 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); | 649 | var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); |
| 650 | Identifier previousId = null; | 650 | Identifier previousId = null; |
| 651 | var previousType = ComplexReferenceChildType.Unknown; | 651 | var previousType = ComplexReferenceChildType.Unknown; |
| 652 | var dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.PerMonitorV2; | ||
| 652 | 653 | ||
| 653 | // The BootstrapperApplication element acts like a Payload element so delegate to the "Payload" attribute parsing code to parse and create a Payload entry. | 654 | // The BootstrapperApplication element acts like a Payload element so delegate to the "Payload" attribute parsing code to parse and create a Payload entry. |
| 654 | var id = this.ParsePayloadElementContent(node, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId, previousType, previousId, false); | 655 | var id = this.ParsePayloadElementContent(node, ComplexReferenceParentType.Container, Compiler.BurnUXContainerId, previousType, previousId, false); |
| @@ -658,6 +659,40 @@ namespace WixToolset.Core | |||
| 658 | previousType = ComplexReferenceChildType.Payload; | 659 | previousType = ComplexReferenceChildType.Payload; |
| 659 | } | 660 | } |
| 660 | 661 | ||
| 662 | foreach (var attrib in node.Attributes()) | ||
| 663 | { | ||
| 664 | if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) | ||
| 665 | { | ||
| 666 | switch (attrib.Name.LocalName) | ||
| 667 | { | ||
| 668 | case "DpiAwareness": | ||
| 669 | var dpiAwarenessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); | ||
| 670 | switch (dpiAwarenessValue) | ||
| 671 | { | ||
| 672 | case "gdiScaled": | ||
| 673 | dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.GdiScaled; | ||
| 674 | break; | ||
| 675 | case "perMonitor": | ||
| 676 | dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.PerMonitor; | ||
| 677 | break; | ||
| 678 | case "perMonitorV2": | ||
| 679 | dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.PerMonitorV2; | ||
| 680 | break; | ||
| 681 | case "system": | ||
| 682 | dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.System; | ||
| 683 | break; | ||
| 684 | case "unaware": | ||
| 685 | dpiAwareness = WixBootstrapperApplicationDpiAwarenessType.Unaware; | ||
| 686 | break; | ||
| 687 | default: | ||
| 688 | this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "DpiAwareness", dpiAwarenessValue, "gdiScaled", "perMonitor", "perMonitorV2", "system", "unaware")); | ||
| 689 | break; | ||
| 690 | } | ||
| 691 | break; | ||
| 692 | } | ||
| 693 | } | ||
| 694 | } | ||
| 695 | |||
| 661 | foreach (var child in node.Elements()) | 696 | foreach (var child in node.Elements()) |
| 662 | { | 697 | { |
| 663 | if (CompilerCore.WixNamespace == child.Name.Namespace) | 698 | if (CompilerCore.WixNamespace == child.Name.Namespace) |
| @@ -702,7 +737,10 @@ namespace WixToolset.Core | |||
| 702 | 737 | ||
| 703 | if (null != id) | 738 | if (null != id) |
| 704 | { | 739 | { |
| 705 | this.Core.AddSymbol(new WixBootstrapperApplicationSymbol(sourceLineNumbers, id)); | 740 | this.Core.AddSymbol(new WixBootstrapperApplicationSymbol(sourceLineNumbers, id) |
| 741 | { | ||
| 742 | DpiAwareness = dpiAwareness, | ||
| 743 | }); | ||
| 706 | } | 744 | } |
| 707 | } | 745 | } |
| 708 | } | 746 | } |
| @@ -1325,6 +1363,12 @@ namespace WixToolset.Core | |||
| 1325 | case "EnableSignatureVerification": | 1363 | case "EnableSignatureVerification": |
| 1326 | enableSignatureVerification = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); | 1364 | enableSignatureVerification = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); |
| 1327 | break; | 1365 | break; |
| 1366 | case "DpiAwareness": | ||
| 1367 | if (node.Name.LocalName != "BootstrapperApplication") | ||
| 1368 | { | ||
| 1369 | this.Core.UnexpectedAttribute(node, attrib); | ||
| 1370 | } | ||
| 1371 | break; | ||
| 1328 | default: | 1372 | default: |
| 1329 | this.Core.UnexpectedAttribute(node, attrib); | 1373 | this.Core.UnexpectedAttribute(node, attrib); |
| 1330 | break; | 1374 | break; |
