修复postinst

This commit is contained in:
gfdgd_xi 2023-02-11 21:47:38 +08:00
parent 00e306208b
commit eace52cc35
3 changed files with 39 additions and 3 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# 使用 pip 安装所需库 # 使用 pip 安装所需库
echo 安装组件 echo 安装组件
python3 -m pip install --upgrade pip --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple python3 -m pip install --upgrade pip --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple
@ -20,6 +20,33 @@ ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-update-bug
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/root-uengine /usr/bin/uengine-root ln -s /opt/apps/com.gitee.uengine.runner.spark/files/root-uengine /usr/bin/uengine-root
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/AutoShell/main.py /usr/bin/uengine-runner-auto-install-bash ln -s /opt/apps/com.gitee.uengine.runner.spark/files/AutoShell/main.py /usr/bin/uengine-runner-auto-install-bash
ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-applist-launch.sh /usr/bin/uengine-runner-applist-launch.sh ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-applist-launch.sh /usr/bin/uengine-runner-applist-launch.sh
# 移除安装错误的 UEngine Ubuntu 补丁
which uengine
if [[ $? != 0 ]] && [[ -f /usr/bin/uengine-loading-ubuntu ]]; then
# 移除补丁
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
sudo rm /home/$username/uengine-launch/run_daemon.sh
done
fi
# 更新 uengine-loading-ubuntu如果存在
if [[ -f /usr/bin/uengine-loading-ubuntu ]]; then
if [ -f /tmp/upgrade-uengine-loading-ubuntu ]; then
rm /tmp/upgrade-uengine-loading-ubuntu
fi
# 下载新版
aria2c -x 16 -s 16 -d /tmp -o upgrade-uengine-loading-ubuntu https://code.gitlink.org.cn/gfdgd_xi/uengine-installer-bak/raw/branch/master/run_daemon.sh
if [ $? == 0 ]; then
# 替换
sudo cp /tmp/upgrade-uengine-loading-ubuntu /usr/bin/uengine-loading-ubuntu
sudo chmod 755 /usr/bin/uengine-loading-ubuntu
fi
rm /tmp/upgrade-uengine-loading-ubuntu
fi
# 刷新图标缓存 # 刷新图标缓存
# 因为 Ubuntu 的问题,省略 # 因为 Ubuntu 的问题,省略
gtk-update-icon-cache /usr/share/icons/bloom > /dev/null | true gtk-update-icon-cache /usr/share/icons/bloom > /dev/null | true

View File

@ -112,8 +112,7 @@ if [[ $? != 0 ]]; then
for username in $(ls /home) for username in $(ls /home)
do do
echo /home/$username echo /home/$username
sudo rm -rfv /home/$username/uengine sudo rm /home/$username/uengine-launch/run_daemon.sh
sudo rm -rfv /home/$username/uengine-launch
done done
zenity --error --no-wrap '--text=抱歉UEngine 安装失败,已移除安装时进行的修改' zenity --error --no-wrap '--text=抱歉UEngine 安装失败,已移除安装时进行的修改'
exit exit

10
uengine-remove.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/bash
sudo apt purge uengine uengine-modules-dkms uengine-android-image -y
sudo rm /usr/share/applications/uengine-loading-ubuntu.desktop
sudo rm /etc/xdg/autostart/uengine-loading-ubuntu.desktop
sudo rm /usr/bin/uengine-loading-ubuntu
for username in $(ls /home)
do
echo /home/$username
sudo rm /home/$username/uengine-launch/run_daemon.sh
done