2023-02-11 21:47:38 +08:00
|
|
|
|
#!/bin/bash
|
2021-08-19 14:08:05 +08:00
|
|
|
|
# 使用 pip 安装所需库
|
2022-12-18 18:00:19 +08:00
|
|
|
|
echo 安装组件
|
2023-07-06 11:16:36 +08:00
|
|
|
|
python3 -m pip install --upgrade ttkthemes --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
|
|
|
|
|
python3 -m pip install --upgrade pyautogui --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
|
|
|
|
|
python3 -m pip install --upgrade keyboard --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
|
|
|
|
|
python3 -m pip install --upgrade pillow --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
|
2022-12-18 18:00:19 +08:00
|
|
|
|
echo 执行完成
|
2021-08-19 14:08:05 +08:00
|
|
|
|
# 建立软链接
|
2022-06-21 10:24:27 +08:00
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner /usr/bin/uengine-runner
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-apk-builder /usr/bin/uengine-apk-builder
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-app-uninstall /usr/bin/uengine-app-uninstall
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-app-install /usr/bin/uengine-app-install
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-clean /usr/bin/uengine-clean
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-about /usr/bin/uengine-runner-about
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-keyboard /usr/bin/uengine-keyboard
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-useadb /usr/bin/uengine-useadb
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-launch.sh /usr/bin/uengine-runner-launch.sh
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug /usr/bin/uengine-runner-update-bug
|
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/root-uengine /usr/bin/uengine-root
|
2023-01-16 13:43:30 +08:00
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/AutoShell/main.py /usr/bin/uengine-runner-auto-install-bash
|
2022-06-21 10:24:27 +08:00
|
|
|
|
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-applist-launch.sh /usr/bin/uengine-runner-applist-launch.sh
|
2023-02-11 21:47:38 +08:00
|
|
|
|
# 移除安装错误的 UEngine Ubuntu 补丁
|
|
|
|
|
which uengine
|
|
|
|
|
if [[ $? != 0 ]] && [[ -f /usr/bin/uengine-loading-ubuntu ]]; then
|
2023-02-11 21:57:54 +08:00
|
|
|
|
echo 移除错误的 UEngine Ubuntu 补丁
|
2023-02-11 21:47:38 +08:00
|
|
|
|
# 移除补丁
|
|
|
|
|
rm /usr/share/applications/uengine-loading-ubuntu.desktop
|
|
|
|
|
rm /etc/xdg/autostart/uengine-loading-ubuntu.desktop
|
|
|
|
|
rm /usr/bin/uengine-loading-ubuntu
|
|
|
|
|
for username in $(ls /home)
|
|
|
|
|
do
|
|
|
|
|
echo /home/$username
|
2023-02-11 21:57:54 +08:00
|
|
|
|
rm /home/$username/uengine-launch/run_daemon.sh
|
2023-02-11 21:47:38 +08:00
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
# 更新 uengine-loading-ubuntu(如果存在)
|
2023-07-06 11:34:58 +08:00
|
|
|
|
if [[ -f /usr/bin/uengine-loading-ubuntu ]] || [[ -f /usr/bin/uengine-loading-binder ]]; then
|
2023-02-11 21:57:54 +08:00
|
|
|
|
echo 更新 uengine-loading-ubuntu
|
2023-07-06 10:48:21 +08:00
|
|
|
|
cp /opt/apps/com.gitee.uengine.runner.spark/files/LoadingBinder/load.sh /usr/bin/uengine-loading-binder
|
2023-02-11 21:47:38 +08:00
|
|
|
|
if [ -f /tmp/upgrade-uengine-loading-ubuntu ]; then
|
|
|
|
|
rm /tmp/upgrade-uengine-loading-ubuntu
|
|
|
|
|
fi
|
|
|
|
|
# 下载新版
|
2023-07-06 10:48:21 +08:00
|
|
|
|
aria2c -x 16 -s 16 -d /tmp -o upgrade-uengine-loading-ubuntu http://uengine-runner.gfdgdxi.top/shell/run_daemon.sh
|
2023-02-11 21:47:38 +08:00
|
|
|
|
if [ $? == 0 ]; then
|
|
|
|
|
# 替换
|
2023-02-11 21:57:54 +08:00
|
|
|
|
cp /tmp/upgrade-uengine-loading-ubuntu /usr/bin/uengine-loading-ubuntu
|
2023-07-06 11:34:58 +08:00
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
cp /opt/apps/com.gitee.uengine.runner.spark/files/Help/shell/run_daemon.sh /usr/bin/uengine-loading-ubuntu
|
2023-02-11 21:47:38 +08:00
|
|
|
|
fi
|
2023-07-06 11:34:58 +08:00
|
|
|
|
chmod 755 /usr/bin/uengine-loading-ubuntu
|
|
|
|
|
for username in $(ls /home)
|
|
|
|
|
do
|
|
|
|
|
echo /home/$username
|
|
|
|
|
cp /usr/bin/uengine-loading-ubuntu /home/$username/uengine-launch/run_daemon.sh
|
|
|
|
|
chmod 755 /home/$username/uengine-launch/run_daemon.sh
|
|
|
|
|
done
|
|
|
|
|
rm -f /tmp/upgrade-uengine-loading-ubuntu
|
2023-02-11 21:47:38 +08:00
|
|
|
|
fi
|
2021-10-05 18:16:50 +08:00
|
|
|
|
# 刷新图标缓存
|
2022-06-19 21:20:28 +08:00
|
|
|
|
# 因为 Ubuntu 的问题,省略
|
2022-06-22 12:18:26 +08:00
|
|
|
|
gtk-update-icon-cache /usr/share/icons/bloom > /dev/null | true
|
2021-09-26 20:16:29 +08:00
|
|
|
|
# 向服务器返回安装数加1(不显示内容且忽略错误)
|
2023-07-06 10:48:21 +08:00
|
|
|
|
python3 /opt/apps/com.gitee.uengine.runner.spark/files/Download.py 2.1.1 > /dev/null | true
|