From 946cd6fa44c6ac00dd621ee1a846a681189c779b Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 2 May 2026 17:30:15 +0100 Subject: [PATCH] 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. --- lgsm/data/debian-12.csv | 2 +- lgsm/data/debian-13.csv | 2 +- lgsm/data/ubuntu-24.04.csv | 2 +- lgsm/data/ubuntu-26.04.csv | 2 +- lgsm/modules/check_deps.sh | 38 ++++++++++++++++++++++++++++++-------- 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/lgsm/data/debian-12.csv b/lgsm/data/debian-12.csv index 2da22f88c..40e325b6c 100644 --- a/lgsm/data/debian-12.csv +++ b/lgsm/data/debian-12.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-17-jre vs wet diff --git a/lgsm/data/debian-13.csv b/lgsm/data/debian-13.csv index 401cf281c..d53dfb44f 100644 --- a/lgsm/data/debian-13.csv +++ b/lgsm/data/debian-13.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/data/ubuntu-24.04.csv b/lgsm/data/ubuntu-24.04.csv index ac683d5d3..0e010abd6 100644 --- a/lgsm/data/ubuntu-24.04.csv +++ b/lgsm/data/ubuntu-24.04.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/data/ubuntu-26.04.csv b/lgsm/data/ubuntu-26.04.csv index ac683d5d3..0e010abd6 100644 --- a/lgsm/data/ubuntu-26.04.csv +++ b/lgsm/data/ubuntu-26.04.csv @@ -130,7 +130,7 @@ ut2k4 ut3 ut99 vh,libc6-dev,libatomic1,libpulse-dev -vints,dotnet-runtime-8.0 +vints,dotnet-runtime-10.0 vpmc,openjdk-25-jre vs wet diff --git a/lgsm/modules/check_deps.sh b/lgsm/modules/check_deps.sh index 3d4109e2c..e4bcad4be 100755 --- a/lgsm/modules/check_deps.sh +++ b/lgsm/modules/check_deps.sh @@ -8,15 +8,28 @@ moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")" fn_install_dotnet_repo() { + local dotnetpackage + dotnetpackage="dotnet-runtime-7.0" + + for dep in "${array_deps_missing[@]}"; do + if [[ "${dep}" == dotnet-runtime-* ]]; then + dotnetpackage="${dep}" + break + fi + done + if [ "${distroid}" == "ubuntu" ]; then - # if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo. - if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>&1; then + # If the required .NET package is unavailable in Ubuntu repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then fn_fetch_file "https://packages.microsoft.com/config/ubuntu/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" sudo dpkg -i /tmp/packages-microsoft-prod.deb fi elif [ "${distroid}" == "debian" ]; then - fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" - sudo dpkg -i /tmp/packages-microsoft-prod.deb + # If the required .NET package is unavailable in Debian repos, add the Microsoft repo. + if ! apt-cache show "${dotnetpackage}" > /dev/null 2>&1; then + fn_fetch_file "https://packages.microsoft.com/config/debian/${distroversion}/packages-microsoft-prod.deb" "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" "" + sudo dpkg -i /tmp/packages-microsoft-prod.deb + fi fi } @@ -281,10 +294,10 @@ fn_deps_detector() { depstatus=1 monoinstalled=false fi - # .NET Core: A .NET Core repo needs to be installed. - elif [ "${deptocheck}" == "dotnet-runtime-7.0" ]; then - # .NET is not installed. - if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0"; then + # .NET runtime: check installed runtime version for any dotnet-runtime-X.Y package. + elif [[ "${deptocheck}" =~ ^dotnet-runtime-([0-9]+\.[0-9]+)$ ]]; then + dotnetrequired="${BASH_REMATCH[1]}" + if [ "$(command -v dotnet 2> /dev/null)" ] && dotnet --list-runtimes | grep -q "Microsoft.NETCore.App ${dotnetrequired}"; then depstatus=0 dotnetinstalled=true else @@ -379,6 +392,15 @@ if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}" fi fi +# Vintage Story tracks newer .NET runtimes; older distro releases may not ship required packages. +if [ "${shortname}" == "vints" ]; then + 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 + fn_print_warning_nl "${gamename} may require newer .NET runtimes than ${distroname} provides." + echo -e "If startup fails due to missing .NET runtime, upgrading to Ubuntu 24.04+ or Debian 12+ is recommended." + fn_script_log_warn "${gamename} may require newer .NET runtimes than ${distroname} provides." + fi +fi + if [ ! -f "${tmpdir}/dependency-no-check.tmp" ] && [ ! -f "${datadir}/${distroid}-${distroversioncsv}.csv" ]; then # Check that the distro dependency csv file exists. fn_check_file_github "lgsm/data" "${distroid}-${distroversioncsv}.csv"