[release/6.0] x64 on ARM64 fixes (#59295)
authorEric StJohn <ericstj@microsoft.com>
Mon, 20 Sep 2021 20:17:54 +0000 (13:17 -0700)
committerGitHub <noreply@github.com>
Mon, 20 Sep 2021 20:17:54 +0000 (13:17 -0700)
* Retarget DOTNETHOME when installing x64 on ARM64 (#58669)

* Only set path in x64 mac installer when installing on x64 (#59210)

* Only set path in x64 mac installer when installing on x64

In other words don't set the path for x64 installer on ARM64

* Remove postinstall script from hostfxr

There should be no need for both the host and hostfxr to set the path to dotnet.

Since the host installs dotnet, it should be the only package responsible for this.

* Make postinstall set install_location on mac

Also refactor script to use a template so that we don't need to fork the script.

* fix some syntax errors in script

* Update src/installer/pkg/sfx/installers/dotnet-host.proj

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Refine uname regular expressions

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
* Updating dependencies from https://github.com/dotnet/arcade build 20210917.3

Co-authored-by: Adeel Mujahid <3840695+am11@users.noreply.github.com>
eng/Version.Details.xml
eng/Versions.props
global.json
src/installer/pkg/sfx/installers/dotnet-host.proj
src/installer/pkg/sfx/installers/dotnet-hostfxr.proj
src/installer/pkg/sfx/installers/host.wxs
src/installer/pkg/sfx/installers/osx_scripts/host/postinstall
src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall [deleted file]

index 250bfd2..44d6d3c 100644 (file)
     </Dependency>
   </ProductDependencies>
   <ToolsetDependencies>
-    <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.ApiCompat" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.GenAPI" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.GenAPI" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.GenFacades" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.GenFacades" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.5.1-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
+    </Dependency>
+    <Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="6.0.0-beta.21467.3">
+      <Uri>https://github.com/dotnet/arcade</Uri>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
     <Dependency Name="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201201-01">
       <Uri>https://github.com/microsoft/vstest</Uri>
       <Uri>https://github.com/dotnet/xharness</Uri>
       <Sha>e9669dc84ecd668d3bbb748758103e23b394ffef</Sha>
     </Dependency>
-    <Dependency Name="Microsoft.DotNet.PackageTesting" Version="6.0.0-beta.21460.7">
+    <Dependency Name="Microsoft.DotNet.PackageTesting" Version="6.0.0-beta.21467.3">
       <Uri>https://github.com/dotnet/arcade</Uri>
-      <Sha>7324320f814152b72295946847ca72413507705a</Sha>
+      <Sha>dd9dbfedbdb31401bb16bba8366f31bbd382549b</Sha>
     </Dependency>
     <Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.21416.5">
       <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
index 7330dc9..55b34e7 100644 (file)
     <!-- SDK dependencies -->
     <MicrosoftDotNetCompatibilityVersion>1.0.0-rc.2.21419.17</MicrosoftDotNetCompatibilityVersion>
     <!-- Arcade dependencies -->
-    <MicrosoftDotNetApiCompatVersion>6.0.0-beta.21460.7</MicrosoftDotNetApiCompatVersion>
-    <MicrosoftDotNetBuildTasksFeedVersion>6.0.0-beta.21460.7</MicrosoftDotNetBuildTasksFeedVersion>
-    <MicrosoftDotNetCodeAnalysisVersion>6.0.0-beta.21460.7</MicrosoftDotNetCodeAnalysisVersion>
-    <MicrosoftDotNetGenAPIVersion>6.0.0-beta.21460.7</MicrosoftDotNetGenAPIVersion>
-    <MicrosoftDotNetGenFacadesVersion>6.0.0-beta.21460.7</MicrosoftDotNetGenFacadesVersion>
-    <MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.21460.7</MicrosoftDotNetXUnitExtensionsVersion>
-    <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.21460.7</MicrosoftDotNetXUnitConsoleRunnerVersion>
-    <MicrosoftDotNetBuildTasksArchivesVersion>6.0.0-beta.21460.7</MicrosoftDotNetBuildTasksArchivesVersion>
-    <MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21460.7</MicrosoftDotNetBuildTasksInstallersVersion>
-    <MicrosoftDotNetBuildTasksPackagingVersion>6.0.0-beta.21460.7</MicrosoftDotNetBuildTasksPackagingVersion>
-    <MicrosoftDotNetBuildTasksWorkloadsPackageVersion>6.0.0-beta.21460.7</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
-    <MicrosoftDotNetRemoteExecutorVersion>6.0.0-beta.21460.7</MicrosoftDotNetRemoteExecutorVersion>
-    <MicrosoftDotNetVersionToolsTasksVersion>6.0.0-beta.21460.7</MicrosoftDotNetVersionToolsTasksVersion>
-    <MicrosoftDotNetPackageTestingVersion>6.0.0-beta.21460.7</MicrosoftDotNetPackageTestingVersion>
+    <MicrosoftDotNetApiCompatVersion>6.0.0-beta.21467.3</MicrosoftDotNetApiCompatVersion>
+    <MicrosoftDotNetBuildTasksFeedVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksFeedVersion>
+    <MicrosoftDotNetCodeAnalysisVersion>6.0.0-beta.21467.3</MicrosoftDotNetCodeAnalysisVersion>
+    <MicrosoftDotNetGenAPIVersion>6.0.0-beta.21467.3</MicrosoftDotNetGenAPIVersion>
+    <MicrosoftDotNetGenFacadesVersion>6.0.0-beta.21467.3</MicrosoftDotNetGenFacadesVersion>
+    <MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.21467.3</MicrosoftDotNetXUnitExtensionsVersion>
+    <MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.21467.3</MicrosoftDotNetXUnitConsoleRunnerVersion>
+    <MicrosoftDotNetBuildTasksArchivesVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksArchivesVersion>
+    <MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksInstallersVersion>
+    <MicrosoftDotNetBuildTasksPackagingVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksPackagingVersion>
+    <MicrosoftDotNetBuildTasksTemplatingVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksTemplatingVersion>
+    <MicrosoftDotNetBuildTasksWorkloadsPackageVersion>6.0.0-beta.21467.3</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
+    <MicrosoftDotNetRemoteExecutorVersion>6.0.0-beta.21467.3</MicrosoftDotNetRemoteExecutorVersion>
+    <MicrosoftDotNetVersionToolsTasksVersion>6.0.0-beta.21467.3</MicrosoftDotNetVersionToolsTasksVersion>
+    <MicrosoftDotNetPackageTestingVersion>6.0.0-beta.21467.3</MicrosoftDotNetPackageTestingVersion>
     <!-- NuGet dependencies -->
     <NuGetBuildTasksPackVersion>6.0.0-preview.1.102</NuGetBuildTasksPackVersion>
     <!-- Installer dependencies -->
index 0cfd182..79641b5 100644 (file)
     "python3": "3.7.1"
   },
   "msbuild-sdks": {
-    "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.21460.7",
-    "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21460.7",
-    "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21460.7",
-    "Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.21460.7",
+    "Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk": "6.0.0-beta.21467.3",
+    "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21467.3",
+    "Microsoft.DotNet.Helix.Sdk": "6.0.0-beta.21467.3",
+    "Microsoft.DotNet.SharedFramework.Sdk": "6.0.0-beta.21467.3",
     "Microsoft.Build.NoTargets": "3.1.0",
     "Microsoft.Build.Traversal": "3.0.23",
     "Microsoft.NET.Sdk.IL": "6.0.0-rc.1.21415.6"
index 953b0f4..aba056f 100644 (file)
@@ -15,7 +15,7 @@
     <UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
     <MacOSComponentNamePackType>sharedhost</MacOSComponentNamePackType>
     <IncludeVersionInMacOSComponentName>false</IncludeVersionInMacOSComponentName>
-    <MacOSScriptsDirectory>osx_scripts/host</MacOSScriptsDirectory>
+    <MacOSScriptsTemplateDirectory>osx_scripts/host</MacOSScriptsTemplateDirectory>
     <MacOSPackageDescription>The .NET Shared Host.</MacOSPackageDescription>
     <RpmScriptsDirectory>$(MSBuildThisFileDirectory)rpm_scripts/host</RpmScriptsDirectory>
     <RpmAfterInstallScript>$(RpmScriptsDirectory)/after_install.sh</RpmAfterInstallScript>
       <RpmJsonProperty Include="@(PackageConflictsProperty)" />
     </ItemGroup>
   </Target>
+
+  <PropertyGroup>
+    <_MacOSIntermediatesPath>$(IntermediateOutputPath)macos/</_MacOSIntermediatesPath>
+    <!-- CreatePkg depends on this property being set.-->
+    <MacOSScriptsDirectory>$(_MacOSIntermediatesPath)scripts</MacOSScriptsDirectory>
+  </PropertyGroup>
+  <ItemGroup>
+    <_MacOSScript Include="$(MacOSScriptsTemplateDirectory)/*" Destination="$(MacOSScriptsDirectory)/%(FileName)%(Extension)"/>
+  </ItemGroup>
+  <Target Name="ReplaceTemplateParametersInMacOsScripts" 
+          Inputs="@(_MacOSScript)"
+          Outputs="@(_MacOSScript->'%(Destination)')"
+          DependsOnTargets="_GetInstallerProperties"
+          BeforeTargets="CreatePkg">
+
+    <PropertyGroup>
+      <_UnameMachineRegex>$(InstallerTargetArchitecture)</_UnameMachineRegex>
+      <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'arm64'">arm64|aarch64</_UnameMachineRegex>
+      <_UnameMachineRegex Condition="'$(InstallerTargetArchitecture)' == 'x64'">amd64|x86_64</_UnameMachineRegex>
+      <_MacOSScriptsTemplateProperties>InstallerTargetArchitecture=$(InstallerTargetArchitecture);UnameMachineRegex=$(_UnameMachineRegex)</_MacOSScriptsTemplateProperties>
+    </PropertyGroup>
+    
+    <GenerateFileFromTemplate TemplateFile="@(_MacOSScript)" 
+                              OutputPath="@(_MacOSScript->'%(Destination)')"
+                              Properties="$(_MacOSScriptsTemplateProperties)">
+      <Output TaskParameter="ResolvedOutputPath" ItemName="FileWrites" />
+    </GenerateFileFromTemplate>
+  </Target>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Templating" Version="$(MicrosoftDotNetBuildTasksTemplatingVersion)" />
+  </ItemGroup>
 </Project>
index 2c5fa5d..b9eb792 100644 (file)
@@ -14,7 +14,6 @@
     <OutputFilesCandleVariable>HostFxrSrc</OutputFilesCandleVariable>
     <UseBrandingNameInLinuxPackageDescription>true</UseBrandingNameInLinuxPackageDescription>
     <MacOSComponentNamePackType>hostfxr</MacOSComponentNamePackType>
-    <MacOSScriptsDirectory>osx_scripts/hostfxr</MacOSScriptsDirectory>
     <MacOSPackageDescription>The .NET HostFxr</MacOSPackageDescription>
   </PropertyGroup>
 
index 773246b..91ca74c 100644 (file)
@@ -5,7 +5,7 @@
 
   <Fragment>
 
-    <ComponentGroup Id="InstallSharedHostandDetectionKeys">
+    <ComponentGroup Id="InstallSharedHostandDetectionKeys" Directory="DOTNETHOME">
 
       <!-- When installing the SharedHost; copy all files to the traditional default install location: 'ProgramFiles'\dotnet even when installing into a custom location.
 
         1. the legacy SDK can be subsequently installed
         2. the user runs 'dotnet' commands directly against 'ProgramFiles'\dotnet\dotnet.exe -->
 
-      <Component Id="cmpCoreHost" Directory="DOTNETHOME" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
+      <Component Id="cmpCoreHost" Guid="{45399BBB-DDA5-4386-A2E9-618FB3C54A18}" >
         <File Id="fileCoreHostExe" KeyPath="yes" Source="$(var.HostSrc)\dotnet.exe">
           <CopyFile Id="copyFileCoreHostExe" DestinationDirectory="PROGRAMFILES_DOTNET" />
         </File>
+      </Component>
+        
+      <Component Id="cmpSharedHostVersionRegistry" Guid="*">
         <RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
-          <RegistryValue Action="write" Name="Version" Type="string" Value="$(var.NugetVersion)"/>
+          <RegistryValue KeyPath="yes" Action="write" Name="Version" Type="string" Value="$(var.NugetVersion)"/>
+        </RegistryKey>
+      </Component>
+
+      <Component Id="cmdPath" Guid="*">
+        <?if $(var.Platform)~=x64 ?>
+        <!-- For x64 installer, only add to PATH when actually on native architecture -->
+        <Condition>NOT NON_NATIVE_ARCHITECTURE</Condition>
+        <?endif?>
+
+        <!-- A stable keypath with the right SxS characteristics for our PATH entry-->
+        <RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedhost">
+          <RegistryValue KeyPath="yes" Action="write" Name="Path" Type="string" Value="[DOTNETHOME]"/>
         </RegistryKey>
         <Environment Id="E_PATH" Name="PATH" Value="[DOTNETHOME]" Part="last" Action="set" System="yes" />
       </Component>
 
-      <Component Id="cmpLicenseFiles" Directory="DOTNETHOME" Guid="{A61CBE5B-1282-4F29-90AD-63597AA2372E}">
+      <Component Id="cmpLicenseFiles" Guid="{A61CBE5B-1282-4F29-90AD-63597AA2372E}">
         <File Id="fileLicenseTxt" KeyPath="yes" Source="$(var.HostSrc)\LICENSE.txt">
           <CopyFile Id="copyFileLicenseTxt" DestinationDirectory="PROGRAMFILES_DOTNET" />
         </File>
     <DirectoryRef Id="$(var.Program_Files)">
       <Directory Id="PROGRAMFILES_DOTNET" Name="dotnet" />
     </DirectoryRef>
+    
+    <?if $(var.Platform)~=x64 ?>
+    <CustomActionRef Id="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" />
+    <?endif?>
   </Fragment>
-
-</Wix>
+  
+  <Fragment>
+    <!-- Unlike DOTNETHOME which gives precedence to a user specified value over an x64 suffix, here we always want the suffixed path -->
+    <SetProperty Action="Set_PROGRAMFILES_DOTNET_NON_NATIVE_ARCHITECTURE" Id="PROGRAMFILES_DOTNET" Value="[$(var.Program_Files)]dotnet\x64\" After="Set_NON_NATIVE_ARCHITECTURE">
+      NON_NATIVE_ARCHITECTURE
+    </SetProperty>
+  </Fragment>
+</Wix>
\ No newline at end of file
index 531cb93..eaee94e 100755 (executable)
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 # Licensed to the .NET Foundation under one or more agreements.
 # The .NET Foundation licenses this file to you under the MIT license.
@@ -10,9 +10,21 @@ INSTALL_DESTINATION=$2
 # A temporary fix for the permissions issue(s)
 chmod 755 $INSTALL_DESTINATION/dotnet
 
-# Add the installation directory to the system-wide paths
-# But first create the directory if it doesn't exist
-mkdir -p /etc/paths.d
-echo $INSTALL_DESTINATION | tee /etc/paths.d/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
+
+# if we're running on the native architecture
+if [[ "$(uname -m)" =~ "${UnameMachineRegex}" ]]; 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
+    echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet
+fi
 
 exit 0
diff --git a/src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall b/src/installer/pkg/sfx/installers/osx_scripts/hostfxr/postinstall
deleted file mode 100755 (executable)
index 2d0ceb8..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-#
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-#
-
-PACKAGE=$1
-INSTALL_DESTINATION=$2
-
-# A temporary fix for the permissions issue(s)
-chmod 755 $INSTALL_DESTINATION/dotnet
-
-# Add the installation directory to the system-wide paths
-echo $INSTALL_DESTINATION | tee /etc/paths.d/dotnet
-
-exit 0