[msitools: 1/3] Default Win64 to true on 64-bit arch




commit ad6981dd3f4a00357611416d9844146a1fe16bb0
Author: roblabla <unfiltered roblab la>
Date:   Fri Nov 12 21:33:13 2021 +0100

    Default Win64 to true on 64-bit arch
    
    In WiX Toolset, the Component::Win64 attribute takes the correct value
    depending on the `--arch` flag being built for. The official
    documentation for Win64 says this:
    
    > The default value is based on the platform set by the -arch switch to
    > candle.exe or the InstallerPlatform property in a .wixproj MSBuild project:
    > For x86 and ARM, the default value is 'no'. For x64, ARM64, and IA64,
    > the default value is 'yes'.
    
    This commit reproduces this behavior: If Win64 is unset, it defaults to
    true when building for x64 and IA64 (WixL doesn't support ARM64 yet).

 tools/wixl/builder.vala | 4 +++-
 tools/wixl/wix.vala     | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/tools/wixl/builder.vala b/tools/wixl/builder.vala
index 319006d..dc31b3b 100644
--- a/tools/wixl/builder.vala
+++ b/tools/wixl/builder.vala
@@ -536,7 +536,9 @@ namespace Wixl {
             else
                 uuid = get_uuid (comp.Guid);
 
-            if (parse_yesno (comp.Win64))
+            if (comp.Win64 != null && parse_yesno (comp.Win64))
+                attr |= ComponentAttribute.64BIT;
+            else if (comp.Win64 == null && (arch == Arch.X64 || arch == Arch.IA64))
                 attr |= ComponentAttribute.64BIT;
 
             db.table_component.add (comp.Id, uuid, dir.Id, attr,
diff --git a/tools/wixl/wix.vala b/tools/wixl/wix.vala
index 6b9722d..fe5cbdd 100644
--- a/tools/wixl/wix.vala
+++ b/tools/wixl/wix.vala
@@ -1102,7 +1102,7 @@ namespace Wixl {
         }
 
         public string Guid { get; set; }
-        public string Win64 { get; set; }
+        public string? Win64 { get; set; }
         public WixKeyElement? key;
 
         public List<WixFeature> in_feature;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]