.NET Core 2+ Naming and Versioning
New file name structure for the runtime and the CLI per: https://github.com/dotnet/designs/issues/2 The renaming of assets, therefore the dotnet installation scripts must change to accommodate. Trivial: "Write-Host" should be "Write-Output"
This commit is contained in:
parent
88a8826925
commit
b48b7d2ea0
11 changed files with 165 additions and 117 deletions
|
@ -9,11 +9,11 @@ param(
|
|||
|
||||
if($Help)
|
||||
{
|
||||
Write-Host "Usage: .\update-dependencies.ps1"
|
||||
Write-Host ""
|
||||
Write-Host "Options:"
|
||||
Write-Host " -Help Display this help message"
|
||||
Write-Host " -Update Update dependencies (but don't open a PR)"
|
||||
Write-Output "Usage: .\update-dependencies.ps1"
|
||||
Write-Output ""
|
||||
Write-Output "Options:"
|
||||
Write-Output " -Help Display this help message"
|
||||
Write-Output " -Update Update dependencies (but don't open a PR)"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ if (!$env:DOTNET_INSTALL_DIR)
|
|||
}
|
||||
|
||||
# Install a stage 0
|
||||
Write-Host "Installing .NET Core CLI Stage 0"
|
||||
Write-Output "Installing .NET Core CLI Stage 0"
|
||||
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
|
||||
|
||||
|
@ -43,11 +43,11 @@ if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
|
|||
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
||||
|
||||
# Restore the app
|
||||
Write-Host "Restoring $ProjectPath..."
|
||||
Write-Output "Restoring $ProjectPath..."
|
||||
dotnet restore "$ProjectPath"
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
|
||||
|
||||
# Run the app
|
||||
Write-Host "Invoking App $ProjectPath..."
|
||||
Write-Output "Invoking App $ProjectPath..."
|
||||
dotnet run -p "$ProjectPath" "$ProjectArgs"
|
||||
if($LASTEXITCODE -ne 0) { throw "Build failed" }
|
||||
|
|
|
@ -25,7 +25,7 @@ function RunCandleForBundle
|
|||
$result = $true
|
||||
pushd "$WixRoot"
|
||||
|
||||
Write-Host Running candle for bundle..
|
||||
Write-Output Running candle for bundle..
|
||||
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
|
||||
|
||||
.\candle.exe -nologo `
|
||||
|
@ -52,7 +52,7 @@ function RunCandleForBundle
|
|||
if($LastExitCode -ne 0)
|
||||
{
|
||||
$result = $false
|
||||
Write-Host "Candle failed with exit code $LastExitCode."
|
||||
Write-Output "Candle failed with exit code $LastExitCode."
|
||||
}
|
||||
|
||||
popd
|
||||
|
@ -64,7 +64,7 @@ function RunLightForBundle
|
|||
$result = $true
|
||||
pushd "$WixRoot"
|
||||
|
||||
Write-Host Running light for bundle..
|
||||
Write-Output Running light for bundle..
|
||||
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
|
||||
|
||||
.\light.exe -nologo `
|
||||
|
@ -80,7 +80,7 @@ function RunLightForBundle
|
|||
if($LastExitCode -ne 0)
|
||||
{
|
||||
$result = $false
|
||||
Write-Host "Light failed with exit code $LastExitCode."
|
||||
Write-Output "Light failed with exit code $LastExitCode."
|
||||
}
|
||||
|
||||
popd
|
||||
|
@ -98,7 +98,7 @@ if(!(Test-Path $ASPNETRuntimeWixLibFile))
|
|||
throw "$ASPNETRuntimeWixLibFile not found"
|
||||
}
|
||||
|
||||
Write-Host "Creating dotnet Bundle at $DotnetBundleOutput"
|
||||
Write-Output "Creating dotnet Bundle at $DotnetBundleOutput"
|
||||
|
||||
if([string]::IsNullOrEmpty($WixRoot))
|
||||
{
|
||||
|
@ -121,6 +121,6 @@ if(!(Test-Path $DotnetBundleOutput))
|
|||
Exit -1
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
|
||||
Write-Output -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput"
|
||||
|
||||
exit $LastExitCode
|
||||
|
|
|
@ -24,14 +24,14 @@ function RunHeat
|
|||
$result = $true
|
||||
pushd "$WixRoot"
|
||||
|
||||
Write-Host Running heat..
|
||||
Write-Output Running heat..
|
||||
|
||||
.\heat.exe dir `"$inputDir`" -template fragment -sreg -gg -var var.DotnetSrc -cg InstallFiles -srd -dr DOTNETHOME -out $InstallFileswsx | Out-Host
|
||||
|
||||
if($LastExitCode -ne 0)
|
||||
{
|
||||
$result = $false
|
||||
Write-Host "Heat failed with exit code $LastExitCode."
|
||||
Write-Output "Heat failed with exit code $LastExitCode."
|
||||
}
|
||||
|
||||
popd
|
||||
|
@ -43,7 +43,7 @@ function RunCandle
|
|||
$result = $true
|
||||
pushd "$WixRoot"
|
||||
|
||||
Write-Host Running candle..
|
||||
Write-Output Running candle..
|
||||
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
|
||||
|
||||
.\candle.exe -nologo `
|
||||
|
@ -64,7 +64,7 @@ function RunCandle
|
|||
if($LastExitCode -ne 0)
|
||||
{
|
||||
$result = $false
|
||||
Write-Host "Candle failed with exit code $LastExitCode."
|
||||
Write-Output "Candle failed with exit code $LastExitCode."
|
||||
}
|
||||
|
||||
popd
|
||||
|
@ -76,7 +76,7 @@ function RunLight
|
|||
$result = $true
|
||||
pushd "$WixRoot"
|
||||
|
||||
Write-Host Running light..
|
||||
Write-Output Running light..
|
||||
$CabCache = Join-Path $WixRoot "cabcache"
|
||||
$AuthWsxRoot = Join-Path $RepoRoot "packaging\windows\clisdk"
|
||||
|
||||
|
@ -95,7 +95,7 @@ function RunLight
|
|||
if($LastExitCode -ne 0)
|
||||
{
|
||||
$result = $false
|
||||
Write-Host "Light failed with exit code $LastExitCode."
|
||||
Write-Output "Light failed with exit code $LastExitCode."
|
||||
}
|
||||
|
||||
popd
|
||||
|
@ -107,7 +107,7 @@ if(!(Test-Path $inputDir))
|
|||
throw "$inputDir not found"
|
||||
}
|
||||
|
||||
Write-Host "Creating dotnet MSI at $DotnetMSIOutput"
|
||||
Write-Output "Creating dotnet MSI at $DotnetMSIOutput"
|
||||
|
||||
if([string]::IsNullOrEmpty($WixRoot))
|
||||
{
|
||||
|
@ -135,6 +135,6 @@ if(!(Test-Path $DotnetMSIOutput))
|
|||
Exit -1
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor Green "Successfully created dotnet MSI - $DotnetMSIOutput"
|
||||
Write-Output -ForegroundColor Green "Successfully created dotnet MSI - $DotnetMSIOutput"
|
||||
|
||||
exit $LastExitCode
|
||||
|
|
|
@ -25,7 +25,7 @@ function DownloadNugetExe
|
|||
}
|
||||
|
||||
if (-not (Test-Path $NuGetExe)) {
|
||||
Write-Host 'Downloading nuget.exe to ' + $NuGetExe
|
||||
Write-Output 'Downloading nuget.exe to ' + $NuGetExe
|
||||
wget https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe -OutFile $NuGetExe
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ function GenerateNupkg
|
|||
{
|
||||
if (-not (Test-Path $NuspecFile))
|
||||
{
|
||||
Write-Host 'Error nuspec not found - $NuspecFile'
|
||||
Write-Output 'Error nuspec not found - $NuspecFile'
|
||||
}
|
||||
|
||||
$SdkBundlePath = [System.IO.Path]::GetFullPath($SdkBundlePath)
|
||||
|
@ -50,7 +50,7 @@ if(!(Test-Path $SdkBundlePath))
|
|||
throw "$SdkBundlePath not found"
|
||||
}
|
||||
|
||||
Write-Host "Creating nupkg for Sdk installer"
|
||||
Write-Output "Creating nupkg for Sdk installer"
|
||||
|
||||
DownloadNugetExe
|
||||
|
||||
|
@ -69,6 +69,6 @@ if(!(Test-Path $NupkgFile))
|
|||
throw "$NupkgFile not generated"
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor Green "Successfully created installer nupkg - $NupkgFile"
|
||||
Write-Output -ForegroundColor Green "Successfully created installer nupkg - $NupkgFile"
|
||||
|
||||
exit $LastExitCode
|
||||
|
|
|
@ -16,14 +16,14 @@ param(
|
|||
|
||||
if($Help)
|
||||
{
|
||||
Write-Host "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-Help]"
|
||||
Write-Host ""
|
||||
Write-Host "Options:"
|
||||
Write-Host " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
|
||||
Write-Host " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
|
||||
Write-Host " -NoPackage Skip packaging targets"
|
||||
Write-Host " -NoBuild Skip building the product"
|
||||
Write-Host " -Help Display this help message"
|
||||
Write-Output "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-Architecture <ARCHITECTURE>] [-NoPackage] [-Help]"
|
||||
Write-Output ""
|
||||
Write-Output "Options:"
|
||||
Write-Output " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
|
||||
Write-Output " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
|
||||
Write-Output " -NoPackage Skip packaging targets"
|
||||
Write-Output " -NoBuild Skip building the product"
|
||||
Write-Output " -Help Display this help message"
|
||||
exit 0
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,7 @@ $env:VSTEST_TRACE_BUILD=1
|
|||
# install a stage0
|
||||
$dotnetInstallPath = Join-Path $RepoRoot "scripts\obtain\dotnet-install.ps1"
|
||||
|
||||
Write-Host "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||
Write-Output "$dotnetInstallPath -Channel ""master"" -Version ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||
Invoke-Expression "$dotnetInstallPath -Channel ""master"" ""2.0.0-preview1-005867"" -InstallDir $env:DOTNET_INSTALL_DIR -Architecture ""$Architecture"""
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
|
@ -89,7 +89,7 @@ if ($LastExitCode -ne 0)
|
|||
}
|
||||
|
||||
|
||||
Write-Host "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
|
||||
Write-Output "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
|
||||
Invoke-Expression "$dotnetInstallPath -Channel ""master"" -InstallDir $env:DOTNET_INSTALL_DIR_PJ -Architecture ""$Architecture"" -Version 1.0.0-preview2-1-003177"
|
||||
if ($LastExitCode -ne 0)
|
||||
{
|
||||
|
@ -102,8 +102,8 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
|||
|
||||
if ($NoBuild)
|
||||
{
|
||||
Write-Host "Not building due to --nobuild"
|
||||
Write-Host "Command that would be run: 'dotnet msbuild build.proj /m /p:Architecture=$Architecture $ExtraParameters'"
|
||||
Write-Output "Not building due to --nobuild"
|
||||
Write-Output "Command that would be run: 'dotnet msbuild build.proj /m /p:Architecture=$Architecture $ExtraParameters'"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -5,17 +5,17 @@
|
|||
|
||||
function header([string]$message)
|
||||
{
|
||||
Write-Host -ForegroundColor Green "*** $message ***"
|
||||
Write-Output -ForegroundColor Green "*** $message ***"
|
||||
}
|
||||
|
||||
function info([string]$message)
|
||||
{
|
||||
Write-Host -ForegroundColor Yellow "*** $message ***"
|
||||
Write-Output -ForegroundColor Yellow "*** $message ***"
|
||||
}
|
||||
|
||||
function error([string]$message)
|
||||
{
|
||||
Write-Host -ForegroundColor Red "$message"
|
||||
Write-Output -ForegroundColor Red "$message"
|
||||
}
|
||||
|
||||
function setEnvIfDefault([string]$envVarName, [string]$value)
|
||||
|
|
|
@ -15,7 +15,7 @@ try {
|
|||
if (Test-Path $stage2) {
|
||||
$env:PATH="$stage2;$env:PATH"
|
||||
} else {
|
||||
Write-Host "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
|
||||
Write-Output "You don't have a dev build in the 'artifacts\$rid\stage2' folder!"
|
||||
}
|
||||
|
||||
dotnet @args
|
||||
|
|
159
scripts/obtain/dotnet-install.ps1
vendored
159
scripts/obtain/dotnet-install.ps1
vendored
|
@ -80,7 +80,7 @@ $VersionRegEx="/\d+\.\d+[^/]+/"
|
|||
$OverrideNonVersionedFiles=$true
|
||||
|
||||
function Say($str) {
|
||||
Write-Host "dotnet-install: $str"
|
||||
Write-Output "dotnet-install: $str"
|
||||
}
|
||||
|
||||
function Say-Verbose($str) {
|
||||
|
@ -93,6 +93,25 @@ function Say-Invocation($Invocation) {
|
|||
Say-Verbose "$command $args"
|
||||
}
|
||||
|
||||
function Invoke-With-Retry([ScriptBlock]$ScriptBlock, [int]$MaxAttempts = 3, [int]$SecondsBetweenAttempts = 1) {
|
||||
$Attempts = 0
|
||||
|
||||
while ($true) {
|
||||
try {
|
||||
return $ScriptBlock.Invoke()
|
||||
}
|
||||
catch {
|
||||
$Attempts++
|
||||
if ($Attempts -lt $MaxAttempts) {
|
||||
Start-Sleep $SecondsBetweenAttempts
|
||||
}
|
||||
else {
|
||||
throw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function Get-Machine-Architecture() {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
|
@ -135,52 +154,56 @@ function Load-Assembly([string] $Assembly) {
|
|||
|
||||
function GetHTTPResponse([Uri] $Uri)
|
||||
{
|
||||
$HttpClient = $null
|
||||
Invoke-With-Retry(
|
||||
{
|
||||
|
||||
try {
|
||||
# HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet.
|
||||
Load-Assembly -Assembly System.Net.Http
|
||||
|
||||
if(-not $ProxyAddress)
|
||||
{
|
||||
# Despite no proxy being explicitly specified, we may still be behind a default proxy
|
||||
$DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy;
|
||||
if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))){
|
||||
$ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString
|
||||
$ProxyUseDefaultCredentials = $true
|
||||
}
|
||||
}
|
||||
$HttpClient = $null
|
||||
|
||||
if($ProxyAddress){
|
||||
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
||||
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials}
|
||||
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
||||
}
|
||||
else {
|
||||
$HttpClient = New-Object System.Net.Http.HttpClient
|
||||
}
|
||||
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
||||
# 10 minutes allows it to work over much slower connections.
|
||||
$HttpClient.Timeout = New-TimeSpan -Minutes 10
|
||||
$Response = $HttpClient.GetAsync($Uri).Result
|
||||
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode)))
|
||||
{
|
||||
$ErrorMsg = "Failed to download $Uri."
|
||||
if ($Response -ne $null)
|
||||
try {
|
||||
# HttpClient is used vs Invoke-WebRequest in order to support Nano Server which doesn't support the Invoke-WebRequest cmdlet.
|
||||
Load-Assembly -Assembly System.Net.Http
|
||||
|
||||
if(-not $ProxyAddress)
|
||||
{
|
||||
$ErrorMsg += " $Response"
|
||||
# Despite no proxy being explicitly specified, we may still be behind a default proxy
|
||||
$DefaultProxy = [System.Net.WebRequest]::DefaultWebProxy;
|
||||
if($DefaultProxy -and (-not $DefaultProxy.IsBypassed($Uri))){
|
||||
$ProxyAddress = $DefaultProxy.GetProxy($Uri).OriginalString
|
||||
$ProxyUseDefaultCredentials = $true
|
||||
}
|
||||
}
|
||||
|
||||
throw $ErrorMsg
|
||||
}
|
||||
if($ProxyAddress){
|
||||
$HttpClientHandler = New-Object System.Net.Http.HttpClientHandler
|
||||
$HttpClientHandler.Proxy = New-Object System.Net.WebProxy -Property @{Address=$ProxyAddress;UseDefaultCredentials=$ProxyUseDefaultCredentials}
|
||||
$HttpClient = New-Object System.Net.Http.HttpClient -ArgumentList $HttpClientHandler
|
||||
}
|
||||
else {
|
||||
$HttpClient = New-Object System.Net.Http.HttpClient
|
||||
}
|
||||
# Default timeout for HttpClient is 100s. For a 50 MB download this assumes 500 KB/s average, any less will time out
|
||||
# 10 minutes allows it to work over much slower connections.
|
||||
$HttpClient.Timeout = New-TimeSpan -Minutes 10
|
||||
$Response = $HttpClient.GetAsync($Uri).Result
|
||||
if (($Response -eq $null) -or (-not ($Response.IsSuccessStatusCode)))
|
||||
{
|
||||
$ErrorMsg = "Failed to download $Uri."
|
||||
if ($Response -ne $null)
|
||||
{
|
||||
$ErrorMsg += " $Response"
|
||||
}
|
||||
|
||||
return $Response
|
||||
}
|
||||
finally {
|
||||
if ($HttpClient -ne $null) {
|
||||
$HttpClient.Dispose()
|
||||
throw $ErrorMsg
|
||||
}
|
||||
|
||||
return $Response
|
||||
}
|
||||
}
|
||||
finally {
|
||||
if ($HttpClient -ne $null) {
|
||||
$HttpClient.Dispose()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
@ -223,10 +246,23 @@ function Get-Specific-Version-From-Version([string]$AzureFeed, [string]$Channel,
|
|||
}
|
||||
}
|
||||
|
||||
function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
function Get-Download-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
$ret = @()
|
||||
if ($SharedRuntime) {
|
||||
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||
}
|
||||
else {
|
||||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-$SpecificVersion-win-$CLIArchitecture.zip"
|
||||
}
|
||||
|
||||
Say-Verbose "Constructed primary payload URL: $PayloadURL"
|
||||
|
||||
return $PayloadURL
|
||||
}
|
||||
|
||||
function Get-AltDownload-Link([string]$AzureFeed, [string]$Channel, [string]$SpecificVersion, [string]$CLIArchitecture) {
|
||||
Say-Invocation $MyInvocation
|
||||
|
||||
if ($SharedRuntime) {
|
||||
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/dotnet-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
|
@ -235,10 +271,9 @@ function Get-Download-Links([string]$AzureFeed, [string]$Channel, [string]$Speci
|
|||
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-dev-win-$CLIArchitecture.$SpecificVersion.zip"
|
||||
}
|
||||
|
||||
Say-Verbose "Constructed payload URL: $PayloadURL"
|
||||
$ret += $PayloadURL
|
||||
Say-Verbose "Constructed alternate payload URL: $PayloadURL"
|
||||
|
||||
return $ret
|
||||
return $PayloadURL
|
||||
}
|
||||
|
||||
function Get-User-Share-Path() {
|
||||
|
@ -396,13 +431,13 @@ function Prepend-Sdk-InstallRoot-To-Path([string]$InstallRoot, [string]$BinFolde
|
|||
|
||||
$CLIArchitecture = Get-CLIArchitecture-From-Architecture $Architecture
|
||||
$SpecificVersion = Get-Specific-Version-From-Version -AzureFeed $AzureFeed -Channel $Channel -Version $Version
|
||||
$DownloadLinks = Get-Download-Links -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
$DownloadLink = Get-Download-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
$AltDownloadLink = Get-AltDownload-Link -AzureFeed $AzureFeed -Channel $Channel -SpecificVersion $SpecificVersion -CLIArchitecture $CLIArchitecture
|
||||
|
||||
if ($DryRun) {
|
||||
Say "Payload URLs:"
|
||||
foreach ($DownloadLink in $DownloadLinks) {
|
||||
Say "- $DownloadLink"
|
||||
}
|
||||
Say "Primary - $DownloadLink"
|
||||
Say "Alternate - $AltDownloadLink"
|
||||
Say "Repeatable invocation: .\$($MyInvocation.MyCommand) -Version $SpecificVersion -Channel $Channel -Architecture $CLIArchitecture -InstallDir $InstallDir"
|
||||
exit 0
|
||||
}
|
||||
|
@ -420,23 +455,31 @@ if ($IsSdkInstalled) {
|
|||
|
||||
New-Item -ItemType Directory -Force -Path $InstallRoot | Out-Null
|
||||
|
||||
$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "$((Get-Item $InstallRoot).PSDrive.Name):"
|
||||
if ($free.Freespace / 1MB -le 250 ) {
|
||||
Say "there is not enough disk space on drive c:"
|
||||
$installDrive = $((Get-Item $InstallRoot).PSDrive.Name);
|
||||
Write-Output "${installDrive}:";
|
||||
$free = Get-CimInstance -Class win32_logicaldisk | where Deviceid -eq "${installDrive}:"
|
||||
if ($free.Freespace / 1MB -le 100 ) {
|
||||
Say "There is not enough disk space on drive ${installDrive}:"
|
||||
exit 0
|
||||
}
|
||||
|
||||
foreach ($DownloadLink in $DownloadLinks) {
|
||||
$ZipPath = [System.IO.Path]::GetTempFileName()
|
||||
Say "Downloading $DownloadLink"
|
||||
try {
|
||||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||
}
|
||||
catch {
|
||||
$DownloadLink = $AltDownloadLink
|
||||
$ZipPath = [System.IO.Path]::GetTempFileName()
|
||||
Say "Downloading $DownloadLink"
|
||||
DownloadFile -Uri $DownloadLink -OutPath $ZipPath
|
||||
|
||||
Say "Extracting zip from $DownloadLink"
|
||||
Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot
|
||||
|
||||
Remove-Item $ZipPath
|
||||
}
|
||||
|
||||
Say "Extracting zip from $DownloadLink"
|
||||
Extract-Dotnet-Package -ZipPath $ZipPath -OutPath $InstallRoot
|
||||
|
||||
Remove-Item $ZipPath
|
||||
|
||||
Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath
|
||||
|
||||
Say "Installation finished"
|
||||
|
|
33
scripts/obtain/dotnet-install.sh
vendored
33
scripts/obtain/dotnet-install.sh
vendored
|
@ -398,9 +398,9 @@ construct_download_link() {
|
|||
|
||||
local download_link=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
download_link="$azure_feed/Runtime/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
download_link="$azure_feed/Runtime/$specific_version/dotnet-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||
else
|
||||
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$specific_version-$osname-$normalized_architecture.tar.gz"
|
||||
fi
|
||||
|
||||
echo "$download_link"
|
||||
|
@ -424,11 +424,20 @@ construct_alt_download_link() {
|
|||
distro_specific_osname=$(get_distro_specific_os_name) || return 1
|
||||
|
||||
local alt_download_link=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
else
|
||||
alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
fi
|
||||
else
|
||||
alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$distro_specific_osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
alt_download_link="$azure_feed/Runtime/$specific_version/dotnet-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
else
|
||||
alt_download_link="$azure_feed/Sdk/$specific_version/dotnet-dev-$osname-$normalized_architecture.$specific_version.tar.gz"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
echo "$alt_download_link"
|
||||
return 0
|
||||
|
@ -615,10 +624,8 @@ calculate_vars() {
|
|||
download_link=$(construct_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||
say_verbose "download_link=$download_link"
|
||||
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||
say_verbose "alt_download_link=$alt_download_link"
|
||||
fi
|
||||
alt_download_link=$(construct_alt_download_link $azure_feed $channel $normalized_architecture $specific_version)
|
||||
say_verbose "alt_download_link=$alt_download_link"
|
||||
|
||||
install_root=$(resolve_installation_path $install_dir)
|
||||
say_verbose "install_root=$install_root"
|
||||
|
@ -640,8 +647,8 @@ install_dotnet() {
|
|||
say "Downloading link: $download_link"
|
||||
download "$download_link" $zip_path || download_failed=true
|
||||
|
||||
# if the download fails, download the alt_download_link [Linux only]
|
||||
if [ "$(uname)" = "Linux" ] && [ "$download_failed" = true ]; then
|
||||
# if the download fails, download the alt_download_link
|
||||
if [ "$download_failed" = true ]; then
|
||||
say "Cannot download: $download_link"
|
||||
zip_path=$(mktemp $temporary_file_template)
|
||||
say_verbose "Alternate zip path: $zip_path"
|
||||
|
@ -768,9 +775,7 @@ check_min_reqs
|
|||
calculate_vars
|
||||
if [ "$dry_run" = true ]; then
|
||||
say "Payload URL: $download_link"
|
||||
if [ "$(uname)" = "Linux" ]; then
|
||||
say "Alternate payload URL: $alt_download_link"
|
||||
fi
|
||||
say "Alternate payload URL: $alt_download_link"
|
||||
say "Repeatable invocation: ./$(basename $0) --version $specific_version --channel $channel --install-dir $install_dir"
|
||||
exit 0
|
||||
fi
|
||||
|
|
|
@ -12,5 +12,5 @@ if (Test-Path $stage2) {
|
|||
$env:PATH="$stage2;$env:PATH"
|
||||
}
|
||||
} else {
|
||||
Write-Host "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!"
|
||||
Write-Output "You don't have a dev build in the 'artifacts\win10-x64\stage2' folder!"
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ function CopyTestXUnitRunner([string]$destination)
|
|||
Copy-Item $XUnitRunnerDir\xunit.runner.utility.desktop.dll -Destination:$destination
|
||||
}
|
||||
|
||||
Write-Host "Running tests for MSI installer at $inputMsi."
|
||||
Write-Output "Running tests for MSI installer at $inputMsi."
|
||||
|
||||
if(!(Test-Path $inputMsi))
|
||||
{
|
||||
|
@ -65,7 +65,7 @@ try {
|
|||
CopyInstaller $testBin
|
||||
CopyTestXUnitRunner $testBin
|
||||
|
||||
Write-Host "Running installer tests in Windows Container"
|
||||
Write-Output "Running installer tests in Windows Container"
|
||||
|
||||
# --net="none" works around a networking issue on the containers on the CI machines.
|
||||
# Since our installer tests don't require the network, it is fine to shut it off.
|
||||
|
|
Loading…
Reference in a new issue