Skip to content

Commit 9fca03c

Browse files
committed
Set install_location arch specific (dotnet#59441)
Also don't write to paths when running translated (rosetta)
1 parent 20bfd6a commit 9fca03c

File tree

1 file changed

+7
-9
lines changed
  • src/installer/pkg/sfx/installers/osx_scripts/host

1 file changed

+7
-9
lines changed

src/installer/pkg/sfx/installers/osx_scripts/host/postinstall

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@
66

77
PACKAGE=$1
88
INSTALL_DESTINATION=$2
9+
[ "${InstallerTargetArchitecture}" == "x64" ] && X64_INSTALL_DESTINATION=$2 || X64_INSTALL_DESTINATION=$2/x64
910

1011
# A temporary fix for the permissions issue(s)
1112
chmod 755 $INSTALL_DESTINATION/dotnet
1213

13-
if [ -e /etc/dotnet/install_location ]; then
14-
# clear out any entries for this architecture if they exist
15-
sed -i old '/^${InstallerTargetArchitecture}=/d' /etc/dotnet/install_location
16-
else
17-
mkdir -p /etc/dotnet
18-
fi
19-
20-
echo ${InstallerTargetArchitecture}=$INSTALL_DESTINATION | tee -a /etc/dotnet/install_location
14+
mkdir -p /etc/dotnet
15+
# set install_location (legacy location) to x64 location (regardless of wether or not we're installing x64)
16+
echo $X64_INSTALL_DESTINATION | tee /etc/dotnet/install_location
17+
# set install_location_arch to point to this installed location
18+
echo $INSTALL_DESTINATION | tee /etc/dotnet/install_location_${InstallerTargetArchitecture}
2119

2220
# if we're running on the native architecture
23-
if [[ "$(uname -m)" =~ "${UnameMachineRegex}" ]]; then
21+
if [[ "$(uname -m)" =~ ${UnameMachineRegex} && "$(sysctl -i -n sysctl.proc_translated)" != "1" ]]; then
2422
# Add the installation directory to the system-wide paths
2523
# But first create the directory if it doesn't exist
2624
mkdir -p /etc/paths.d

0 commit comments

Comments
 (0)