From 3a6004831e39db3c032110f7155e9eb004c89ee5 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Tue, 21 Sep 2021 15:48:26 -0700 Subject: [PATCH] Set install_location arch specific Also don't write to paths when running translated (rosetta) --- .../sfx/installers/osx_scripts/host/postinstall | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall index eaee94e2798738..3eba436d925092 100755 --- a/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall +++ b/src/installer/pkg/sfx/installers/osx_scripts/host/postinstall @@ -6,21 +6,19 @@ PACKAGE=$1 INSTALL_DESTINATION=$2 +[ "${InstallerTargetArchitecture}" == "x64" ] && X64_INSTALL_DESTINATION=$2 || X64_INSTALL_DESTINATION=$2/x64 # A temporary fix for the permissions issue(s) chmod 755 $INSTALL_DESTINATION/dotnet -if [ -e /etc/dotnet/install_location ]; then - # clear out any entries for this architecture if they exist - sed -i old '/^${InstallerTargetArchitecture}=/d' /etc/dotnet/install_location -else - mkdir -p /etc/dotnet -fi - -echo ${InstallerTargetArchitecture}=$INSTALL_DESTINATION | tee -a /etc/dotnet/install_location +mkdir -p /etc/dotnet +# set install_location (legacy location) to x64 location (regardless of wether or not we're installing x64) +echo $X64_INSTALL_DESTINATION | tee /etc/dotnet/install_location +# set install_location_arch to point to this installed location +echo $INSTALL_DESTINATION | tee /etc/dotnet/install_location_${InstallerTargetArchitecture} # if we're running on the native architecture -if [[ "$(uname -m)" =~ "${UnameMachineRegex}" ]]; then +if [[ "$(uname -m)" =~ ${UnameMachineRegex} && "$(sysctl -i -n sysctl.proc_translated)" != "1" ]]; then # Add the installation directory to the system-wide paths # But first create the directory if it doesn't exist mkdir -p /etc/paths.d