Skip to content

Commit cc372bb

Browse files
Merge pull request #42 from joshmgross/joshmgross/update-install-scripts
Update external install scripts
2 parents d9c317d + 86c0b21 commit cc372bb

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Main workflow
2-
on: [push]
2+
on: [push, pull_request]
33
jobs:
44
run:
55
name: Run

externals/install-dotnet.ps1

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
Possible values:
4747
- dotnet - the Microsoft.NETCore.App shared runtime
4848
- aspnetcore - the Microsoft.AspNetCore.App shared runtime
49+
- windowsdesktop - the Microsoft.WindowsDesktop.App shared runtime
4950
.PARAMETER DryRun
5051
If set it will not perform installation but instead display what command line to use to consistently install
5152
currently requested version of dotnet cli. In example if you specify version 'latest' it will display a link
@@ -83,7 +84,7 @@ param(
8384
[string]$Version="Latest",
8485
[string]$InstallDir="<auto>",
8586
[string]$Architecture="<auto>",
86-
[ValidateSet("dotnet", "aspnetcore", IgnoreCase = $false)]
87+
[ValidateSet("dotnet", "aspnetcore", "windowsdesktop", IgnoreCase = $false)]
8788
[string]$Runtime,
8889
[Obsolete("This parameter may be removed in a future version of this script. The recommended alternative is '-Runtime dotnet'.")]
8990
[switch]$SharedRuntime,
@@ -268,6 +269,10 @@ function Get-Latest-Version-Info([string]$AzureFeed, [string]$Channel, [bool]$Co
268269
elseif ($Runtime -eq "aspnetcore") {
269270
$VersionFileUrl = "$UncachedFeed/aspnetcore/Runtime/$Channel/latest.version"
270271
}
272+
# Currently, the WindowsDesktop runtime is manufactured with the .Net core runtime
273+
elseif ($Runtime -eq "windowsdesktop") {
274+
$VersionFileUrl = "$UncachedFeed/Runtime/$Channel/latest.version"
275+
}
271276
elseif (-not $Runtime) {
272277
if ($Coherent) {
273278
$VersionFileUrl = "$UncachedFeed/Sdk/$Channel/latest.coherent.version"
@@ -325,6 +330,9 @@ function Get-Download-Link([string]$AzureFeed, [string]$SpecificVersion, [string
325330
elseif ($Runtime -eq "aspnetcore") {
326331
$PayloadURL = "$AzureFeed/aspnetcore/Runtime/$SpecificVersion/aspnetcore-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
327332
}
333+
elseif ($Runtime -eq "windowsdesktop") {
334+
$PayloadURL = "$AzureFeed/Runtime/$SpecificVersion/windowsdesktop-runtime-$SpecificVersion-win-$CLIArchitecture.zip"
335+
}
328336
elseif (-not $Runtime) {
329337
$PayloadURL = "$AzureFeed/Sdk/$SpecificVersion/dotnet-sdk-$SpecificVersion-win-$CLIArchitecture.zip"
330338
}
@@ -564,6 +572,10 @@ elseif ($Runtime -eq "aspnetcore") {
564572
$assetName = "ASP.NET Core Runtime"
565573
$dotnetPackageRelativePath = "shared\Microsoft.AspNetCore.App"
566574
}
575+
elseif ($Runtime -eq "windowsdesktop") {
576+
$assetName = ".NET Core Windows Desktop Runtime"
577+
$dotnetPackageRelativePath = "shared\Microsoft.WindowsDesktop.App"
578+
}
567579
elseif (-not $Runtime) {
568580
$assetName = ".NET Core SDK"
569581
$dotnetPackageRelativePath = "sdk"

externals/install-dotnet.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ get_linux_platform_name() {
148148
return 0
149149
elif [ -e /etc/redhat-release ]; then
150150
local redhatRelease=$(</etc/redhat-release)
151-
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux Server release 6."* ]]; then
151+
if [[ $redhatRelease == "CentOS release 6."* || $redhatRelease == "Red Hat Enterprise Linux "*" release 6."* ]]; then
152152
echo "rhel.6"
153153
return 0
154154
fi
@@ -612,6 +612,9 @@ copy_files_or_dirs_from_list() {
612612
local target="$out_path/$path"
613613
if [ "$override" = true ] || (! ([ -d "$target" ] || [ -e "$target" ])); then
614614
mkdir -p "$out_path/$(dirname "$path")"
615+
if [ -d "$target" ]; then
616+
rm -rf "$target"
617+
fi
615618
cp -R $override_switch "$root_path/$path" "$target"
616619
fi
617620
done
@@ -868,6 +871,9 @@ do
868871
runtime="$1"
869872
if [[ "$runtime" != "dotnet" ]] && [[ "$runtime" != "aspnetcore" ]]; then
870873
say_err "Unsupported value for --runtime: '$1'. Valid values are 'dotnet' and 'aspnetcore'."
874+
if [[ "$runtime" == "windowsdesktop" ]]; then
875+
say_err "WindowsDesktop archives are manufactured for Windows platforms only."
876+
fi
871877
exit 1
872878
fi
873879
;;

0 commit comments

Comments
 (0)