Merge pull request #3011 from eerhardt/FixInstallScript
Fix install scripts to deal with content type change.
This commit is contained in:
commit
418d827d52
3 changed files with 15 additions and 3 deletions
8
scripts/obtain/dotnet-install.ps1
vendored
8
scripts/obtain/dotnet-install.ps1
vendored
|
@ -116,7 +116,13 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
|
||||||
|
|
||||||
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version"
|
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version"
|
||||||
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
|
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
|
||||||
$VersionText = [Text.Encoding]::UTF8.GetString($Response.Content)
|
|
||||||
|
switch ($Response.Headers.'Content-Type'){
|
||||||
|
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($Response.Content) }
|
||||||
|
{ ($_ -eq "text/plain") } { $VersionText = $Response.Content }
|
||||||
|
default { throw "``$Response.Headers.'Content-Type'`` is an unknown .version file content type." }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText
|
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,13 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$AzureChannel, [str
|
||||||
|
|
||||||
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version"
|
$VersionFileUrl = "$AzureFeed/$AzureChannel/dnvm/latest.win.$CLIArchitecture.version"
|
||||||
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
|
$Response = Invoke-WebRequest -UseBasicParsing $VersionFileUrl
|
||||||
$VersionText = [Text.Encoding]::UTF8.GetString($Response.Content)
|
|
||||||
|
switch ($Response.Headers.'Content-Type'){
|
||||||
|
{ ($_ -eq "application/octet-stream") } { $VersionText = [Text.Encoding]::UTF8.GetString($Response.Content) }
|
||||||
|
{ ($_ -eq "text/plain") } { $VersionText = $Response.Content }
|
||||||
|
default { throw "``$Response.Headers.'Content-Type'`` is an unknown .version file content type." }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText
|
$VersionInfo = Get-Version-Info-From-Version-Text $VersionText
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ if (!(Test-Path $env:DOTNET_INSTALL_DIR))
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install a stage 0
|
# Install a stage 0
|
||||||
Write-Host "Installing .NET Core CLI Stage 0 from beta channel"
|
Write-Host "Installing .NET Core CLI ($Architecture) Stage 0 from '$env:CHANNEL' channel"
|
||||||
& "$PSScriptRoot\obtain\dotnet-install.ps1" -Channel $env:CHANNEL -Architecture $Architecture -Verbose
|
& "$PSScriptRoot\obtain\dotnet-install.ps1" -Channel $env:CHANNEL -Architecture $Architecture -Verbose
|
||||||
|
|
||||||
# Put the stage0 on the path
|
# Put the stage0 on the path
|
||||||
|
|
Loading…
Reference in a new issue