Skip to content

Commit 946cd6f

Browse files
authored
fix(deps): update .NET runtime version for Vintage Story (#4913)
* Changed `dotnet-runtime-8.0` to `dotnet-runtime-10.0` in dependency lists for Ubuntu and Debian. * Enhanced the `check_deps.sh` script to dynamically check for the required .NET runtime version. * Added a warning for users on older distributions regarding potential missing .NET runtimes.
1 parent 88d82c0 commit 946cd6f

5 files changed

Lines changed: 34 additions & 12 deletions

File tree

lgsm/data/debian-12.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ut2k4
130130
ut3
131131
ut99
132132
vh,libc6-dev,libatomic1,libpulse-dev
133-
vints,dotnet-runtime-8.0
133+
vints,dotnet-runtime-10.0
134134
vpmc,openjdk-17-jre
135135
vs
136136
wet

lgsm/data/debian-13.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ut2k4
130130
ut3
131131
ut99
132132
vh,libc6-dev,libatomic1,libpulse-dev
133-
vints,dotnet-runtime-8.0
133+
vints,dotnet-runtime-10.0
134134
vpmc,openjdk-25-jre
135135
vs
136136
wet

lgsm/data/ubuntu-24.04.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ut2k4
130130
ut3
131131
ut99
132132
vh,libc6-dev,libatomic1,libpulse-dev
133-
vints,dotnet-runtime-8.0
133+
vints,dotnet-runtime-10.0
134134
vpmc,openjdk-25-jre
135135
vs
136136
wet

lgsm/data/ubuntu-26.04.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ ut2k4
130130
ut3
131131
ut99
132132
vh,libc6-dev,libatomic1,libpulse-dev
133-
vints,dotnet-runtime-8.0
133+
vints,dotnet-runtime-10.0
134134
vpmc,openjdk-25-jre
135135
vs
136136
wet

lgsm/modules/check_deps.sh

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,28 @@
88
moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
99

1010
fn_install_dotnet_repo() {
11+
local dotnetpackage
12+
dotnetpackage="dotnet-runtime-7.0"
13+
14+
for dep in "${array_deps_missing[@]}"; do
15+
if [[ "${dep}" == dotnet-runtime-* ]]; then
16+
dotnetpackage="${dep}"
17+
break
18+
fi
19+
done
20+
1121
if [ "${distroid}" == "ubuntu" ]; then
12-
# if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo.
13-
if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then
22+
# If the required .NET package is unavailable in Ubuntu repos, add the Microsoft repo.
23+
if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then
1424
fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
1525
sudo dpkg -i /tmp/packages-microsoft-prod.deb
1626
fi
1727
elif [ "${distroid}" == "debian" ]; then
18-
fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
19-
sudo dpkg -i /tmp/packages-microsoft-prod.deb
28+
# If the required .NET package is unavailable in Debian repos, add the Microsoft repo.
29+
if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then
30+
fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
31+
sudo dpkg -i /tmp/packages-microsoft-prod.deb
32+
fi
2033
fi
2134
}
2235

@@ -281,10 +294,10 @@ fn_deps_detector() {
281294
depstatus=1
282295
monoinstalled=false
283296
fi
284-
# .NET Core: A .NET Core repo needs to be installed.
285-
elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then
286-
# .NET is not installed.
287-
if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then
297+
# .NET runtime: check installed runtime version for any dotnet-runtime-X.Y package.
298+
elif [[ "${deptocheck}" =~ ^dotnet-runtime-([0-9]+\.[0-9]+)$ ]]; then
299+
dotnetrequired="${BASH_REMATCH[1]}"
300+
if [ "$(command -v dotnet 2> /dev/null)" ] && dotnet --list-runtimes | grep -q "Microsoft.NETCore.App ${dotnetrequired}"; then
288301
depstatus=0
289302
dotnetinstalled=true
290303
else
@@ -379,6 +392,15 @@ if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}"
379392
fi
380393
fi
381394

395+
# Vintage Story tracks newer .NET runtimes; older distro releases may not ship required packages.
396+
if [ "${shortname}" == "vints" ]; then
397+
if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" "lt" "24.04"; } || { [ "${distroid}" == "debian" ] && dpkg --compare-versions "${distroversion}" "lt" "12"; } || [ "${distroid}" == "centos" ] || [ "${distroid}" == "rhel" ] || [ "${distroid}" == "rocky" ] || [ "${distroid}" == "almalinux" ]; then
398+
fn_print_warning_nl "${gamename} may require newer .NET runtimes than ${distroname} provides."
399+
echo -e "If startup fails due to missing .NET runtime, upgrading to Ubuntu 24.04+ or Debian 12+ is recommended."
400+
fn_script_log_warn "${gamename} may require newer .NET runtimes than ${distroname} provides."
401+
fi
402+
fi
403+
382404
if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then
383405
# Check that the distro dependency csv file exists.
384406
fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"

0 commit comments

Comments
 (0)