@ -8,15 +8,28 @@
moduleselfname = " $( basename " $( readlink -f " ${ BASH_SOURCE [0] } " ) " ) "
moduleselfname = " $( basename " $( readlink -f " ${ BASH_SOURCE [0] } " ) " ) "
fn_install_dotnet_repo( ) {
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 [ " ${ distroid } " = = "ubuntu" ] ; then
# if package dotnet-runtime-7.0 is unavailable in ubuntu repos, add the microsoft repo.
# If the required .NET package is unavailable in Ubuntu repos, add the M icrosoft repo.
if ! apt-cache show dotnet-runtime-7.0 > /dev/null 2>& 1; then
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" "" "" "" ""
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
sudo dpkg -i /tmp/packages-microsoft-prod.deb
fi
fi
elif [ " ${ distroid } " = = "debian" ] ; then
elif [ " ${ distroid } " = = "debian" ] ; then
fn_fetch_file " https://packages.microsoft.com/config/debian/ ${ distroversion } /packages-microsoft-prod.deb " "" "" "" "/tmp" "packages-microsoft-prod.deb" "" "" "" ""
# If the required .NET package is unavailable in Debian repos, add the Microsoft repo.
sudo dpkg -i /tmp/packages-microsoft-prod.deb
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
fi
}
}
@ -281,10 +294,10 @@ fn_deps_detector() {
depstatus = 1
depstatus = 1
monoinstalled = false
monoinstalled = false
fi
fi
# .NET Core: A .NET Core repo needs to be installed .
# .NET runtime: check installed runtime version for any dotnet-runtime-X.Y package .
elif [ " ${ deptocheck } " = = "dotnet-runtime-7.0" ] ; then
elif [ [ " ${ deptocheck } " = ~ ^dotnet-runtime-( [ 0-9] +\. [ 0-9] +) $ ] ] ; then
# .NET is not installed.
dotnetrequired = " ${ BASH_REMATCH [1] } "
if dotnet --list-runtimes | grep -q "Microsoft.NETCore.App 7.0 " ; then
if [ " $( command -v dotnet 2> /dev/null) " ] && dotnet --list-runtimes | grep -q " Microsoft.NETCore.App ${ dotnetrequired } "; then
depstatus = 0
depstatus = 0
dotnetinstalled = true
dotnetinstalled = true
else
else
@ -379,6 +392,15 @@ if { [ "${distroid}" == "ubuntu" ] && dpkg --compare-versions "${distroversion}"
fi
fi
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
if [ ! -f " ${ tmpdir } /dependency-no-check.tmp " ] && [ ! -f " ${ datadir } / ${ distroid } - ${ distroversioncsv } .csv " ] ; then
# Check that the distro dependency csv file exists.
# Check that the distro dependency csv file exists.
fn_check_file_github "lgsm/data" " ${ distroid } - ${ distroversioncsv } .csv "
fn_check_file_github "lgsm/data" " ${ distroid } - ${ distroversioncsv } .csv "