Skip to content

Commit

Permalink
Fix SDK installation on ARM64
Browse files Browse the repository at this point in the history
  • Loading branch information
AArnott committed Sep 2, 2021
1 parent ad83aa0 commit 9ac560c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/Install-DotNetSdk.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ $DotNetInstallScriptRoot = Resolve-Path $DotNetInstallScriptRoot
# Look up actual required .NET Core SDK version from global.json
$sdkVersion = & "$PSScriptRoot/../azure-pipelines/variables/DotNetSdkVersion.ps1"

$arch = 'x64'
if ($env:PROCESSOR_ARCHITECTURE -eq 'ARM64') { $arch = 'ARM64' }

# Search for all .NET Core runtime versions referenced from MSBuild projects and arrange to install them.
$runtimeVersions = @()
$windowsDesktopRuntimeVersions = @()
Expand All @@ -51,7 +54,7 @@ Get-ChildItem "$PSScriptRoot\..\src\*.*proj","$PSScriptRoot\..\test\*.*proj","$P
$windowsDesktopRuntimeVersions += $v
}
}

# Add target frameworks of the form: netXX
$targetFrameworks |? { $_ -match 'net(\d+\.\d+)' } |% {
$v = $Matches[1]
Expand Down Expand Up @@ -86,7 +89,7 @@ Function Get-InstallerExe($Version, [switch]$Runtime) {
$Version = $versionInfo[-1]
}

Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sdkOrRuntime/$Version/dotnet-$($sdkOrRuntime.ToLowerInvariant())-$Version-win-x64.exe" -OutDir "$DotNetInstallScriptRoot"
Get-FileFromWeb -Uri "https://dotnetcli.blob.core.windows.net/dotnet/$sdkOrRuntime/$Version/dotnet-$($sdkOrRuntime.ToLowerInvariant())-$Version-win-$arch.exe" -OutDir "$DotNetInstallScriptRoot"
}

Function Install-DotNet($Version, [switch]$Runtime) {
Expand All @@ -103,7 +106,7 @@ Function Install-DotNet($Version, [switch]$Runtime) {
}

$switches = @(
'-Architecture','x64'
'-Architecture',$arch
)
$envVars = @{
# For locally installed dotnet, skip first time experience which takes a long time
Expand Down

0 comments on commit 9ac560c

Please sign in to comment.