2023-11-11 23:12:30 +08:00
|
|
|
|
#!/bin/bash
|
|
|
|
|
function notify-send(){
|
|
|
|
|
#Detect the user using such display
|
|
|
|
|
local user=$(who | awk '{print $1}' | head -n 1)
|
|
|
|
|
|
|
|
|
|
#Detect the id of the user
|
|
|
|
|
local uid=$(id -u $user)
|
|
|
|
|
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus notify-send "$@"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function zenity(){
|
|
|
|
|
#Detect the user using such display
|
|
|
|
|
local user=$(who | awk '{print $1}' | head -n 1)
|
|
|
|
|
|
|
|
|
|
#Detect the id of the user
|
|
|
|
|
local uid=$(id -u $user)
|
|
|
|
|
sudo -u $user DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$uid/bus zenity "$@"
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-04 12:17:04 +08:00
|
|
|
|
### 判断 ACE 类型
|
|
|
|
|
if [[ `arch` == "loongarch64" ]]; then
|
|
|
|
|
# loongarch 架构有多个 ACE,优先安装至旧世界的 ACE
|
|
|
|
|
if [[ ! -z `which bookworm-run` ]]; then
|
|
|
|
|
aceCommand="bookworm-run"
|
|
|
|
|
fi
|
|
|
|
|
if [[ ! -z `which loongnix-run` ]]; then
|
|
|
|
|
aceCommand="loongnix-run"
|
|
|
|
|
fi
|
|
|
|
|
if [[ $aceCommand == "" ]]; then
|
|
|
|
|
echo "Oh no, ssinstall have not installed bookworm-run dependency yet! Exit"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
echo "Installing Wine Runner to " $aceCommand
|
|
|
|
|
else
|
|
|
|
|
###检查aptss在不在
|
|
|
|
|
if [ -z `which bookworm-run` ];then
|
|
|
|
|
echo "Oh no, ssinstall have not installed bookworm-run dependency yet! Exit"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
aceCommand="bookworm-run"
|
2023-11-11 23:12:30 +08:00
|
|
|
|
fi
|
2024-04-04 12:17:04 +08:00
|
|
|
|
|
|
|
|
|
$aceCommand echo "Welcome to BCM! Trying to install package"
|
2024-04-04 17:56:56 +08:00
|
|
|
|
if [ -z "`$aceCommand which aptss`" ];then
|
2023-11-11 23:12:30 +08:00
|
|
|
|
wget https://zunyun01.store.deepinos.org.cn/store/depends/spark-store-console-in-container_4.2.6.2_all.deb -O /tmp/ssconsole.deb
|
2024-04-04 12:17:04 +08:00
|
|
|
|
$aceCommand apt install /tmp/ssconsole.deb -y
|
2023-11-11 23:12:30 +08:00
|
|
|
|
rm /tmp/ssconsole.deb -f
|
|
|
|
|
fi
|
|
|
|
|
notify-send "Installing Wine Runner BCM, may cost some time please ensure your network is fine"
|
|
|
|
|
notify-send "正在书虫兼容环境中安装 Wine 运行器,可能会花费一些时间,请保持网络畅通"
|
2024-04-04 12:17:04 +08:00
|
|
|
|
$aceCommand aptss update
|
2023-11-11 23:12:30 +08:00
|
|
|
|
cp /opt/apps/spark-deepin-wine-runner-ace/spark-deepin-wine-runner.deb /tmp
|
2024-04-04 12:17:04 +08:00
|
|
|
|
$aceCommand aptss reinstall /tmp/spark-deepin-wine-runner.deb -y
|
2023-11-11 23:12:30 +08:00
|
|
|
|
|
2024-04-04 12:17:04 +08:00
|
|
|
|
$aceCommand aptss clean
|