Skip to content

Commit 05cc3cb

Browse files
committed
feat(install): update .NET SDK installation to include latest version
- Enhances the script to install both LTS (Long Term Support) and STS (Standard Term Support - latest) versions of the .NET SDK. - Updates description in setup configuration for clarity. - Adds cleanup step for temporary files post-installation. - Sets environment variable for .NET CLI telemetry opt-out.
1 parent 1d78c19 commit 05cc3cb

2 files changed

Lines changed: 30 additions & 8 deletions

File tree

src/scripts/install-dotnet-sdk.sh

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Install .NET SDK
3+
# Install .NET SDK (both LTS and Latest versions)
44

55
echo "Installing .NET SDK..."
66

@@ -18,27 +18,49 @@ case ${ARCH} in
1818
*) echo "Unsupported architecture: ${ARCH}"; exit 1 ;;
1919
esac
2020

21-
# Use Microsoft's official installation script
22-
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel LTS --install-dir /usr/share/dotnet
21+
# Download the installation script
22+
curl -sSL https://dot.net/v1/dotnet-install.sh -o /tmp/dotnet-install.sh
23+
chmod +x /tmp/dotnet-install.sh
24+
25+
# Install LTS version (Long Term Support)
26+
echo "Installing .NET SDK LTS version..."
27+
/tmp/dotnet-install.sh --channel LTS --install-dir /usr/share/dotnet
28+
29+
# Install STS version (Standard Term Support - latest)
30+
echo "Installing .NET SDK STS (latest) version..."
31+
/tmp/dotnet-install.sh --channel STS --install-dir /usr/share/dotnet
2332

2433
# Add dotnet to PATH and create symlinks
25-
ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet
34+
ln -sf /usr/share/dotnet/dotnet /usr/bin/dotnet
2635

2736
# Export DOTNET_ROOT
2837
export DOTNET_ROOT=/usr/share/dotnet
2938
echo "export DOTNET_ROOT=/usr/share/dotnet" >> /etc/environment
3039

40+
# Enable .NET CLI telemetry opt-out
41+
export DOTNET_CLI_TELEMETRY_OPTOUT=1
42+
echo "export DOTNET_CLI_TELEMETRY_OPTOUT=1" >> /etc/environment
43+
44+
# Clean up
45+
rm -f /tmp/dotnet-install.sh
46+
3147
# Verify installation
3248
echo "Verifying .NET SDK installation..."
3349
if ! command -v dotnet &> /dev/null; then
3450
echo "ERROR: dotnet command not found after installation"
3551
exit 1
3652
fi
37-
echo ".NET SDK version:"
53+
54+
echo "Default .NET SDK version:"
3855
dotnet --version
39-
echo ".NET SDKs installed:"
56+
57+
echo ""
58+
echo "All installed .NET SDKs:"
4059
dotnet --list-sdks
41-
echo ".NET Runtimes installed:"
60+
61+
echo ""
62+
echo "All installed .NET Runtimes:"
4263
dotnet --list-runtimes
4364

65+
echo ""
4466
echo ".NET SDK installation completed successfully!"

src/setup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ setup:
4949

5050
- name: "Install .NET SDK"
5151
script: "scripts/install-dotnet-sdk.sh"
52-
description: "Installs .NET SDK (LTS version)"
52+
description: "Installs .NET SDK (both LTS and latest versions)"
5353

5454
- name: "Install dnsutils"
5555
script: "scripts/install-dnsutils.sh"

0 commit comments

Comments
 (0)