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
|
$InstallRoot = Resolve-Installation-Path $InstallDir
|
||||||
Say-Verbose "InstallRoot: $InstallRoot"
|
Say-Verbose "InstallRoot: $InstallRoot"
|
||||||
|
|
||||||
$IsSdkInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage "sdk" -SpecificVersion $SpecificVersion
|
$dotnetPackageRelativePath = if ($SharedRuntime) { "shared\Microsoft.NETCore.App" } else { "sdk" }
|
||||||
Say-Verbose ".NET SDK installed? $IsSdkInstalled"
|
|
||||||
if ($IsSdkInstalled) {
|
$isAssetInstalled = Is-Dotnet-Package-Installed -InstallRoot $InstallRoot -RelativePathToPackage $dotnetPackageRelativePath -SpecificVersion $SpecificVersion
|
||||||
Say ".NET SDK version $SpecificVersion is already installed."
|
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
|
Prepend-Sdk-InstallRoot-To-Path -InstallRoot $InstallRoot -BinFolderRelativePath $BinFolderRelativePath
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
14
scripts/obtain/dotnet-install.sh
vendored
14
scripts/obtain/dotnet-install.sh
vendored
|
@ -688,9 +688,16 @@ install_dotnet() {
|
||||||
eval $invocation
|
eval $invocation
|
||||||
local download_failed=false
|
local download_failed=false
|
||||||
|
|
||||||
if is_dotnet_package_installed "$install_root" "sdk" "$specific_version"; then
|
if [ "$shared_runtime" = true ]; then
|
||||||
say ".NET SDK version $specific_version is already installed."
|
if is_dotnet_package_installed "$install_root" "shared/Microsoft.NETCore.App" "$specific_version"; then
|
||||||
return 0
|
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
|
fi
|
||||||
|
|
||||||
mkdir -p "$install_root"
|
mkdir -p "$install_root"
|
||||||
|
@ -786,7 +793,6 @@ do
|
||||||
runtime_id="$1"
|
runtime_id="$1"
|
||||||
;;
|
;;
|
||||||
--skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles)
|
--skip-non-versioned-files|-[Ss]kip[Nn]on[Vv]ersioned[Ff]iles)
|
||||||
shift
|
|
||||||
override_non_versioned_files=false
|
override_non_versioned_files=false
|
||||||
;;
|
;;
|
||||||
-?|--?|-h|--help|-[Hh]elp)
|
-?|--?|-h|--help|-[Hh]elp)
|
||||||
|
|
Loading…
Reference in a new issue