Fix dotnet-install to check the right path for no-op installs when --shared-runtime is specified
This commit is contained in:
parent
174c9ff60e
commit
2c931b810d
2 changed files with 19 additions and 8 deletions
13
scripts/obtain/dotnet-install.ps1
vendored
13
scripts/obtain/dotnet-install.ps1
vendored
|
@ -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
|
||||
}
|
||||
|
|
14
scripts/obtain/dotnet-install.sh
vendored
14
scripts/obtain/dotnet-install.sh
vendored
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue