From 89c03c5412672fbabb3751954d42f54f52c8169e Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 22 Oct 2021 09:54:43 -0700 Subject: [PATCH 1/2] Add check for running under translation to mac installers MacOs runs installers built for pre-Big-Sur under rosetta. Detect this and redirect to x64 subdirectory. --- .../shared-framework-distribution-template.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml b/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml index 74f140436a8fc0..cb8178ff25cfae 100644 --- a/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml +++ b/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml @@ -43,14 +43,18 @@ var machine = system.sysctl("hw.machine"); var cputype = system.sysctl("hw.cputype"); var cpu64 = system.sysctl("hw.cpu64bit_capable"); + var translated = system.sysctl(""sysctl.proc_translated""); system.log("Machine type: " + machine); system.log("Cpu type: " + cputype); system.log("64-bit: " + cpu64); + system.log(""Translated: "" + translated); // From machine.h // CPU_TYPE_X86_64 = CPU_TYPE_X86 | CPU_ARCH_ABI64 = 0x010000007 = 16777223 // CPU_TYPE_X86 = 7 var result = machine == "amd64" || machine == "x86_64" || cputype == "16777223" || (cputype == "7" && cpu64 == "1"); + // We may be running under translation (Rosetta) that makes it seem like system is x64, if so assume machine is not actually x64 + result = result && (translated != ""1""); system.log("IsX64Machine: " + result); return result; }]]> From fc123cec52118d5b8adb9fa95c43fa5191f92da2 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 22 Oct 2021 11:43:08 -0700 Subject: [PATCH 2/2] Fix strings to be single quoted Ported from a C# task which requires quote escaping, here this is actual distribution file which does not need escaping. --- .../shared-framework-distribution-template.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml b/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml index cb8178ff25cfae..611da4515df683 100644 --- a/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml +++ b/src/installer/pkg/packaging/osx/sharedframework/shared-framework-distribution-template.xml @@ -43,18 +43,18 @@ var machine = system.sysctl("hw.machine"); var cputype = system.sysctl("hw.cputype"); var cpu64 = system.sysctl("hw.cpu64bit_capable"); - var translated = system.sysctl(""sysctl.proc_translated""); + var translated = system.sysctl("sysctl.proc_translated"); system.log("Machine type: " + machine); system.log("Cpu type: " + cputype); system.log("64-bit: " + cpu64); - system.log(""Translated: "" + translated); + system.log("Translated: " + translated); // From machine.h // CPU_TYPE_X86_64 = CPU_TYPE_X86 | CPU_ARCH_ABI64 = 0x010000007 = 16777223 // CPU_TYPE_X86 = 7 var result = machine == "amd64" || machine == "x86_64" || cputype == "16777223" || (cputype == "7" && cpu64 == "1"); // We may be running under translation (Rosetta) that makes it seem like system is x64, if so assume machine is not actually x64 - result = result && (translated != ""1""); + result = result && (translated != "1"); system.log("IsX64Machine: " + result); return result; }]]>