@joebigelow / wix-1 / commits / df8cf532

Add missing ARM64 cases & random fixes.

Bob Arnson committed May 17, 2020 at 17:30 UTC df8cf532fb8f77947664b95901122b8b47fe562b
4 files changed +45 -23
src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs
+1 -1
@@ -90,7 +90,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind
90 {
91 if (null != record)
92 {
93 - // since the cabinets are stored in case-sensitive streams inside the msi, but the file system is not case-sensitive,
93 + // since the cabinets are stored in case-sensitive streams inside the msi, but the file system is not (typically) case-sensitive,
94 // embedded cabinets must be extracted to a canonical file name (like their diskid) to ensure extraction will always work
95 var cabinetFile = Path.Combine(this.IntermediateFolder, String.Concat("Media", Path.DirectorySeparatorChar, diskId.ToString(CultureInfo.InvariantCulture), ".cab"));
96
src/WixToolset.Core/Compiler.cs
+15 -3
@@ -78,6 +78,12 @@ namespace WixToolset.Core
78 /// <value>The platform which the compiler will use when defaulting 64-bit attributes and elements.</value>
79 public Platform CurrentPlatform => this.Context.Platform;
80
81 + /// <summary>
82 + /// Gets or sets the platform which the compiler will use when defaulting 64-bit attributes and elements.
83 + /// </summary>
84 + /// <value>The platform which the compiler will use when defaulting 64-bit attributes and elements.</value>
85 + public bool IsCurrentPlatform64Bit => this.Context.Platform == Platform.ARM64 || this.Context.Platform == Platform.IA64 || this.Context.Platform == Platform.X64;
86 +
87 /// <summary>
88 /// Gets or sets the option to show pedantic messages.
89 /// </summary>
@@ -1777,7 +1783,7 @@ namespace WixToolset.Core
1783 }
1784 }
1785
1780 - if (!explicitWin64 && (Platform.IA64 == this.CurrentPlatform || Platform.X64 == this.CurrentPlatform))
1786 + if (!explicitWin64 && this.IsCurrentPlatform64Bit)
1787 {
1788 search64bit = true;
1789 }
@@ -2250,7 +2256,7 @@ namespace WixToolset.Core
2256 }
2257 }
2258
2253 - if (!explicitWin64 && (Platform.IA64 == this.CurrentPlatform || Platform.X64 == this.CurrentPlatform))
2259 + if (!explicitWin64 && this.IsCurrentPlatform64Bit)
2260 {
2261 //bits |= MsiInterop.MsidbComponentAttributes64bit;
2262 win64 = true;
@@ -3405,7 +3411,7 @@ namespace WixToolset.Core
3411 id = Identifier.Invalid;
3412 }
3413
3408 - if (!explicitWin64 && (CustomActionTargetType.VBScript == targetType || CustomActionTargetType.JScript == targetType) && (Platform.IA64 == this.CurrentPlatform || Platform.X64 == this.CurrentPlatform))
3414 + if (!explicitWin64 && this.IsCurrentPlatform64Bit && (CustomActionTargetType.VBScript == targetType || CustomActionTargetType.JScript == targetType))
3415 {
3416 win64 = true;
3417 }
@@ -5510,6 +5516,12 @@ namespace WixToolset.Core
5516 case "ia64":
5517 procArch = "ia64";
5518 break;
5519 + case "arm":
5520 + procArch = "arm";
5521 + break;
5522 + case "arm64":
5523 + procArch = "arm64";
5524 + break;
5525 case "":
5526 break;
5527 default:
src/WixToolset.Core/Compiler_2.cs
+26 -19
@@ -632,23 +632,27 @@ namespace WixToolset.Core
632
633 switch (this.CurrentPlatform)
634 {
635 - case Platform.X86:
636 - platform = "Intel";
637 - break;
638 - case Platform.X64:
639 - platform = "x64";
640 - msiVersion = 200;
641 - break;
642 - case Platform.IA64:
643 - platform = "Intel64";
644 - msiVersion = 200;
645 - break;
646 - case Platform.ARM:
647 - platform = "Arm";
648 - msiVersion = 500;
649 - break;
650 - default:
651 - throw new ArgumentException("Unknown platform enumeration '{0}' encountered.", this.CurrentPlatform.ToString());
635 + case Platform.X86:
636 + platform = "Intel";
637 + break;
638 + case Platform.X64:
639 + platform = "x64";
640 + msiVersion = 200;
641 + break;
642 + case Platform.IA64:
643 + platform = "Intel64";
644 + msiVersion = 200;
645 + break;
646 + case Platform.ARM:
647 + platform = "Arm";
648 + msiVersion = 500;
649 + break;
650 + case Platform.ARM64:
651 + platform = "Arm64";
652 + msiVersion = 500;
653 + break;
654 + default:
655 + throw new ArgumentException("Unknown platform enumeration '{0}' encountered.", this.CurrentPlatform.ToString());
656 }
657
658 foreach (var attrib in node.Attributes())
@@ -768,6 +772,9 @@ namespace WixToolset.Core
772 case "arm":
773 platform = "Arm";
774 break;
775 + case "arm64":
776 + platform = "Arm64";
777 + break;
778 case "":
779 break;
780 default:
@@ -813,13 +820,13 @@ namespace WixToolset.Core
820 this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "InstallPrivileges", "InstallScope"));
821 }
822
816 - if ((0 != String.Compare(platform, "Intel", StringComparison.OrdinalIgnoreCase)) && 200 > msiVersion)
823 + if ((String.Equals(platform, "X64", StringComparison.OrdinalIgnoreCase) || String.Equals(platform, "Intel64", StringComparison.OrdinalIgnoreCase)) && 200 > msiVersion)
824 {
825 msiVersion = 200;
826 this.Core.Write(WarningMessages.RequiresMsi200for64bitPackage(sourceLineNumbers));
827 }
828
822 - if ((0 == String.Compare(platform, "Arm", StringComparison.OrdinalIgnoreCase)) && 500 > msiVersion)
829 + if ((String.Equals(platform, "Arm", StringComparison.OrdinalIgnoreCase) || String.Equals(platform, "Arm64", StringComparison.OrdinalIgnoreCase)) && 500 > msiVersion)
830 {
831 msiVersion = 500;
832 this.Core.Write(WarningMessages.RequiresMsi500forArmPackage(sourceLineNumbers));
src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
+3
@@ -244,6 +244,9 @@ namespace WixToolset.Core.ExtensibilityServices
244 case Platform.ARM:
245 return "arm";
246
247 + case Platform.ARM64:
248 + return "arm64";
249 +
250 default:
251 throw new ArgumentException("Unknown platform enumeration '{0}' encountered.", context.Platform.ToString());
252 }