From ce38f90a9a1180f9da601b2db51d29b769bc65ec Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Fri, 5 Feb 2021 11:21:42 +0300 Subject: [PATCH 1/2] Update installer scripts --- externals/install-dotnet.ps1 | 101 ++++++++++++++++++++--------------- externals/install-dotnet.sh | 40 ++++++++++---- 2 files changed, 89 insertions(+), 52 deletions(-) diff --git a/externals/install-dotnet.ps1 b/externals/install-dotnet.ps1 index ff26a05..4646429 100644 --- a/externals/install-dotnet.ps1 +++ b/externals/install-dotnet.ps1 @@ -340,9 +340,8 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel) { elseif ($Runtime -eq "aspnetcore") { $VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version" } - # Currently, the WindowsDesktop runtime is manufactured with the .Net core runtime elseif ($Runtime -eq "windowsdesktop") { - $VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version" + $VersionFileUrl = "$UncachedFeed/WindowsDesktop/$Channel/latest.version" } elseif (-not $Runtime) { $VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.version" @@ -438,7 +437,16 @@ function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string $PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" } elseif ($Runtime -eq "windowsdesktop") { + # The windows desktop runtime is part of the core runtime layout prior to 5.0 $PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" + if ($SpecificVersion -match '^(\d+)\.(.*)$') + { + $majorVersion = [int]$Matches[1] + if ($majorVersion -ge 5) + { + $PayloadURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/windowsdesktop-runtime-$SpecificProductVersion-win-$CLIArchitecture.zip" + } + } } elseif (-not $Runtime) { $PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificProductVersion-win-$CLIArchitecture.zip" @@ -480,7 +488,16 @@ function Get-Product-Version([string]$AzureFeed, [string]$SpecificVersion) { $ProductVersionTxtURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/productVersion.txt" } elseif ($Runtime -eq "windowsdesktop") { + # The windows desktop runtime is part of the core runtime layout prior to 5.0 $ProductVersionTxtURL = "$AzureFeed/Runtime/$SpecificVersion/productVersion.txt" + if ($SpecificVersion -match '^(\d+)\.(.*)') + { + $majorVersion = [int]$Matches[1] + if ($majorVersion -ge 5) + { + $ProductVersionTxtURL = "$AzureFeed/WindowsDesktop/$SpecificVersion/productVersion.txt" + } + } } elseif (-not $Runtime) { $ProductVersionTxtURL = "$AzureFeed/Sdk/$SpecificVersion/productVersion.txt" @@ -885,10 +902,10 @@ Say "Note that the script does not resolve dependencies during installation." Say "To check the list of dependencies, go to https://docs.microsoft.com/dotnet/core/install/windows#dependencies" Say "Installation finished" # SIG # Begin signature block -# MIIjkgYJKoZIhvcNAQcCoIIjgzCCI38CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# MIIjjwYJKoZIhvcNAQcCoIIjgDCCI3wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCD2c707qnCLOLIC -# n6Mu5Gr4+Xp68foyZlGlTycnycc5l6CCDYEwggX/MIID56ADAgECAhMzAAABh3IX +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCNsnhcJvx/hXmM +# w8KjuvvIMDBFonhg9XJFc1QwfTyH4aCCDYEwggX/MIID56ADAgECAhMzAAABh3IX # chVZQMcJAAAAAAGHMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD # VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kM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UBAu68tWSxeceRfWNsb/ZZfUi +# v89hpLssI/Gf1BEgNMA4zCuIGQiC8okusVumEpAhhvCEbSiTTTtBdolTnU/CAKui +# oxaU3R9XkKh1F4oAM26+dJ1J2BLQXPs5afNvvedDsZWNQUPK1sFF3JRfzxiTrwBW +# EJRyflev9gyDoqCHzippgb+6+eti1WTkcA9Q49GIT11S6LOAVqkSC9N7Nqf8ksh8 +# ARdwT8jigpsm+mj7lrVU9upDkhVYhKeO8oiZq95Q53Zkteo= # SIG # End signature block diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index 753a45b..13d30ad 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -303,7 +303,7 @@ get_machine_architecture() { echo "arm" return 0 ;; - aarch64) + aarch64|arm64) echo "arm64" return 0 ;; @@ -744,13 +744,31 @@ download() { fi local failed=false - if machine_has "curl"; then - downloadcurl "$remote_path" "$out_path" || failed=true - elif machine_has "wget"; then - downloadwget "$remote_path" "$out_path" || failed=true - else - failed=true - fi + local attempts=0 + while [ $attempts -lt 3 ]; do + attempts=$((attempts+1)) + failed=false + if machine_has "curl"; then + downloadcurl "$remote_path" "$out_path" || failed=true + elif machine_has "wget"; then + downloadwget "$remote_path" "$out_path" || failed=true + else + unset http_code + download_error_msg="Missing dependency: neither curl nor wget was found." + break + fi + + if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then + break + fi + + say "Download attempt #$attempts has failed: $http_code $download_error_msg" + say "Attempt #$((attempts+1)) will start in $((attempts*10)) seconds." + sleep $((attempts*20)) + done + + + if [ "$failed" = true ]; then say_verbose "Download failed: $remote_path" return 1 @@ -761,6 +779,8 @@ download() { # Updates global variables $http_code and $download_error_msg downloadcurl() { eval $invocation + unset http_code + unset download_error_msg local remote_path="$1" local out_path="${2:-}" # Append feed_credential as late as possible before calling curl to avoid logging feed_credential @@ -789,6 +809,8 @@ downloadcurl() { # Updates global variables $http_code and $download_error_msg downloadwget() { eval $invocation + unset http_code + unset download_error_msg local remote_path="$1" local out_path="${2:-}" # Append feed_credential as late as possible before calling wget to avoid logging feed_credential @@ -882,7 +904,6 @@ install_dotnet() { say "Downloading primary link $download_link" # The download function will set variables $http_code and $download_error_msg in case of failure. - http_code=""; download_error_msg="" download "$download_link" "$zip_path" 2>&1 || download_failed=true primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" @@ -906,7 +927,6 @@ install_dotnet() { say "Downloading legacy link $download_link" # The download function will set variables $http_code and $download_error_msg in case of failure. - http_code=""; download_error_msg="" download "$download_link" "$zip_path" 2>&1 || download_failed=true legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" From 3c80e97cbdf5b47ad0207d8183c953c6eca77b5d Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Thu, 11 Feb 2021 10:32:14 +0300 Subject: [PATCH 2/2] Update Linux installer --- externals/install-dotnet.sh | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index 13d30ad..8ffe169 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -489,7 +489,7 @@ get_specific_version_from_version() { local json_file="$5" if [ -z "$json_file" ]; then - if [[ "$version" == "latest" ]]; then + if [[ "$version" == "latest" ]]; then local version_info version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" @@ -522,7 +522,7 @@ construct_download_link() { local specific_version="${4//[$'\t\r\n']}" local specific_product_version="$(get_specific_product_version "$1" "$4")" local osname="$5" - + local download_link=null if [[ "$runtime" == "dotnet" ]]; then download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" @@ -542,7 +542,7 @@ construct_download_link() { # azure_feed - $1 # specific_version - $2 get_specific_product_version() { - # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents + # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents # to resolve the version of what's in the folder, superseding the specified version. eval $invocation @@ -753,9 +753,8 @@ download() { elif machine_has "wget"; then downloadwget "$remote_path" "$out_path" || failed=true else - unset http_code - download_error_msg="Missing dependency: neither curl nor wget was found." - break + say_err "Missing dependency: neither curl nor wget was found." + exit 1 fi if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then @@ -905,10 +904,10 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" # if the download fails, download the legacy_download_link if [ "$download_failed" = true ]; then + primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" case $primary_path_http_code in 404) say "The resource at $download_link is not available." @@ -928,9 +927,9 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" if [ "$download_failed" = true ]; then + legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" case $legacy_path_http_code in 404) say "The resource at $download_link is not available." @@ -1132,10 +1131,10 @@ do echo " --arch,-Architecture,-Arch" echo " Possible values: x64, arm, and arm64" echo " --os Specifies operating system to be used when selecting the installer." - echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." - echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." + echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." + echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." echo " Not supported for legacy links. Use --runtime-id to specify platform for legacy links." - echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." + echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." echo " --runtime Installs a shared runtime only, without the SDK." echo " -Runtime" echo " Possible values:" @@ -1160,7 +1159,7 @@ do echo " Installs just the shared runtime bits, not the entire SDK." echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." echo " -RuntimeId" The parameter is obsolete and may be removed in a future version of this script. Should be used only for versions below 2.1. - echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." + echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." echo "" echo "Install Location:" echo " Location is chosen in following order:" @@ -1197,7 +1196,7 @@ if [ "$dry_run" = true ]; then if [ "$valid_legacy_download_link" = true ]; then say "Legacy named payload URL: $legacy_download_link" fi - repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" + repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" if [[ "$runtime" == "dotnet" ]]; then repeatable_command+=" --runtime "\""dotnet"\""" elif [[ "$runtime" == "aspnetcore" ]]; then