From 091ed12f53e2775bc2e913dadb498934892dbb38 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 11 Feb 2023 21:57:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=BB=E9=99=A4=E5=9C=A8?= =?UTF-8?q?=20Ubuntu=20=E4=B8=8A=E5=AE=89=E8=A3=85=E7=9A=84=20UEngine=20?= =?UTF-8?q?=E5=8F=8A=E5=85=B6=E9=99=84=E5=B1=9E=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 ++ mainwindow.py | 3 +++ new-deb-build/DEBIAN/postinst | 14 +++++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f640c40..ed54a2a 100755 --- a/Makefile +++ b/Makefile @@ -51,6 +51,8 @@ build: cp -rv run-program-without-wayland.sh new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ cp -rv ProgramFen.py new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ cp -rv Icon new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ + cp -rv CompareVersion.py new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ + cp -rv uengine-remove.sh new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ rm -rfv new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/Help/information python3 RemovePycacheFile.py #new-deb-build/opt/apps/com.gitee.uengine.runner.spark/files/ cp -rv new-deb-build /tmp/uengine-runner-builder diff --git a/mainwindow.py b/mainwindow.py index 2746da1..e276443 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -1981,6 +1981,7 @@ uengineCheckCpu = QtWidgets.QAction(QtGui.QIcon.fromTheme("cpu"), langFile[lang] uengineDeleteUengineCheck = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(40), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][9]) uengineReinstall = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][10]) uengineUbuntuInstall = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][14]) +uengineUbuntuRemove = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "移除在 Ubuntu 上安装的 UEngine 及其附属脚本") uengineUbuntuInstallRoot = QtWidgets.QAction(QtGui.QIcon.fromTheme("ubuntu-logo-icon"), "在 Ubuntu 上安装 UEngine(SuperSU 镜像)") uengineWindowSizeSetting = QtWidgets.QAction(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["Menu"][16]) uengine.addAction(uengineOpenDebBuilder) @@ -1990,6 +1991,7 @@ uengine.addAction(uengineCheckCpu) uengine.addSeparator() uengine.addAction(uengineUbuntuInstall) uengine.addAction(uengineUbuntuInstallRoot) +uengine.addAction(uengineUbuntuRemove) uengine.addSeparator() uengine.addAction(uengineWindowSizeSetting) uengine.addSeparator() @@ -2011,6 +2013,7 @@ uengineRoot = uengine.addMenu(langFile[lang]["Main"]["MainWindow"]["Menu"][2]["M # 绑定信号 uengineAllowOrDisallowUpdateAndroidApp.triggered.connect(AllowOrDisallowUpdateAndroidApp) uengineSetHttpProxy.triggered.connect(SetHttpProxy) +uengineUbuntuRemove.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"bash '{programPath}/uengine-remove.sh'"]).start()) uengineOpenDebBuilder.triggered.connect(OpenUengineDebBuilder) uengineOpenDebBuilderMore.triggered.connect(lambda: threading.Thread(target=os.system, args=[f"'{programPath}/uengine-apk-builder-more'"]).start()) uengineKeyboardToMouse.triggered.connect(KeyboardToMouse) diff --git a/new-deb-build/DEBIAN/postinst b/new-deb-build/DEBIAN/postinst index c41aedc..834a3df 100755 --- a/new-deb-build/DEBIAN/postinst +++ b/new-deb-build/DEBIAN/postinst @@ -23,6 +23,7 @@ ln -s /opt/apps/com.gitee.uengine.runner.spark/files/uengine-runner-applist-laun # 移除安装错误的 UEngine Ubuntu 补丁 which uengine if [[ $? != 0 ]] && [[ -f /usr/bin/uengine-loading-ubuntu ]]; then + echo 移除错误的 UEngine Ubuntu 补丁 # 移除补丁 rm /usr/share/applications/uengine-loading-ubuntu.desktop rm /etc/xdg/autostart/uengine-loading-ubuntu.desktop @@ -30,11 +31,12 @@ if [[ $? != 0 ]] && [[ -f /usr/bin/uengine-loading-ubuntu ]]; then for username in $(ls /home) do echo /home/$username - sudo rm /home/$username/uengine-launch/run_daemon.sh + rm /home/$username/uengine-launch/run_daemon.sh done fi # 更新 uengine-loading-ubuntu(如果存在) if [[ -f /usr/bin/uengine-loading-ubuntu ]]; then + echo 更新 uengine-loading-ubuntu if [ -f /tmp/upgrade-uengine-loading-ubuntu ]; then rm /tmp/upgrade-uengine-loading-ubuntu fi @@ -42,8 +44,14 @@ if [[ -f /usr/bin/uengine-loading-ubuntu ]]; then 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 + cp /tmp/upgrade-uengine-loading-ubuntu /usr/bin/uengine-loading-ubuntu + 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 fi rm /tmp/upgrade-uengine-loading-ubuntu fi