From c6e2213e818b869c44c1af7355fc06f45ebf1a1f Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Thu, 11 Feb 2021 13:46:45 -0800 Subject: Replace Win64 attribute with Bitness attribute Closes wixtoolset/#4707 --- src/WixToolset.Core/Compiler_Bundle.cs | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'src/WixToolset.Core/Compiler_Bundle.cs') diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs index 944f089e..7a386de7 100644 --- a/src/WixToolset.Core/Compiler_Bundle.cs +++ b/src/WixToolset.Core/Compiler_Bundle.cs @@ -33,7 +33,7 @@ namespace WixToolset.Core Identifier id = null; string key = null; string valueName = null; - var win64 = YesNoType.NotSet; + var win64 = this.Context.IsCurrentPlatform64Bit; foreach (var attrib in node.Attributes()) { @@ -44,15 +44,30 @@ namespace WixToolset.Core case "Id": id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); break; + case "Bitness": + var bitnessValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + switch (bitnessValue) + { + case "always32": + win64 = false; + break; + case "always64": + win64 = true; + break; + case "default": + case "": + break; + default: + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, bitnessValue, "default", "always32", "always64")); + break; + } + break; case "Key": key = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; case "Value": valueName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; - case "Win64": - win64 = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; default: this.Core.UnexpectedAttribute(node, attrib); break; @@ -76,7 +91,7 @@ namespace WixToolset.Core var attributes = WixApprovedExeForElevationAttributes.None; - if (win64 == YesNoType.Yes) + if (win64) { attributes |= WixApprovedExeForElevationAttributes.Win64; } -- cgit v1.2.3-55-g6feb