diff --git a/scripts/obtain/dotnet-install.ps1 b/scripts/obtain/dotnet-install.ps1 index e267edc76..1b92f0c20 100644 --- a/scripts/obtain/dotnet-install.ps1 +++ b/scripts/obtain/dotnet-install.ps1 @@ -472,10 +472,15 @@ if ($DryRun) { $InstallRoot = Resolve-Installation-Path $InstallDir Say-Verbose "InstallRoot: $InstallRoot" -$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion -Say-Verbose ".NET SDK installed? $IsSdkInstalled" -if ($IsSdkInstalled) { - Say ".NET SDK version $SpecificVersion is already installed." +$dotnetPackageRelativePath = if ($SharedRuntime) { "shared\Microsoft.NETCore.App" } else { "sdk" } + +$isAssetInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage $dotnetPackageRelativePath -SpecificVersion $SpecificVersion +if ($isAssetInstalled) { + if ($SharedRuntime) { + Say ".NET Core Runtime version $SpecificVersion is already installed." + } else { + Say ".NET Core SDK version $SpecificVersion is already installed." + } Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath exit 0 } diff --git a/scripts/obtain/dotnet-install.sh b/scripts/obtain/dotnet-install.sh index 628751836..e69e3a1fa 100755 --- a/scripts/obtain/dotnet-install.sh +++ b/scripts/obtain/dotnet-install.sh @@ -688,9 +688,16 @@ install_dotnet() { eval $invocation local download_failed=false - if is_dotnet_package_installed "$install_root" "sdk" "$specific_version"; then - say ".NET SDK version $specific_version is already installed." - return 0 + if [ "$shared_runtime" = true ]; then + if is_dotnet_package_installed "$install_root" "shared/Microsoft.NETCore.App" "$specific_version"; then + say ".NET Core Runtime version $specific_version is already installed." + return 0 + fi + else + if is_dotnet_package_installed "$install_root" "sdk" "$specific_version"; then + say ".NET Core SDK version $specific_version is already installed." + return 0 + fi fi mkdir -p "$install_root" @@ -786,7 +793,6 @@ do runtime_id="$1" ;; --skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles) - shift override_non_versioned_files=false ;; -?|--?|-h|--help|-[Hh]elp)