新增环境检测

This commit is contained in:
2023-02-11 19:39:41 +08:00
parent e0aed7a1b5
commit 7b8af878ab
3 changed files with 52 additions and 0 deletions

View File

@@ -1,4 +1,30 @@
#/bin/bash
# 判断安装条件
CheckEnv(){
# 检测是不是 Ubuntu
lsb_release -i | grep -i ubuntu
if [[ $? != 0 ]]; then
zenity --error --no-wrap '--text=您的系统无法安装 UEngine原因此脚本只支持 Ubuntu'
exit
fi
# 检测架构
if [[ `arch` != "x86_64" ]]; then
zenity --error --no-wrap '--text=您的系统无法安装 UEngine原因暂不支持非 X86 架构'
exit
fi
# 检测内核
kernel=`uname -r`
python3 "${programPath}/CompareVersion.py" "${kernel}" "5.17.3"
if [[ $? == 0 ]]; then
zenity --warning --no-wrap "--text=提示:您当前使用的内核版本是${kernel},而一会将会安装内核 5.17.3\n如果要使用 UEngine请在重启后选择该版本内核启动否则无法启动"
fi
#exit
}
programPath=$(cd $(dirname $0); pwd)
# 先判断是否符合安装条件
CheckEnv
echo 1
#exit
# 在 Shenmo 制作的脚本的基础上进行了修改,修复在 Wayland 下运行错误和无法安装程序的问题
# 建议在 Ubuntu 22.04 及以上版本安装,最好在此之前先安装星火应用商店并将系统和星火应用商店更新到最新版本
#is_tar_checked="0"