From acaa13e8aea4df9a9eeb1b569bf2dae00a6fb0ea Mon Sep 17 00:00:00 2001 From: gfdgd xi <3025613752@qq.com> Date: Mon, 20 Jun 2022 09:22:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=90=AF=E5=8A=A8=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 3 +-- uengine-launch.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 uengine-launch.sh diff --git a/main.py b/main.py index 216be9d..caecd86 100755 --- a/main.py +++ b/main.py @@ -41,7 +41,6 @@ import tkinter.simpledialog as simpledialog from getxmlimg import getsavexml win = tk.Tk() # 创建窗口 -win.tk.call('tk', 'scaling', 1.25) # 卸载程序 def UninstallProgram(package: "apk 包名")->"卸载程序": @@ -1266,7 +1265,7 @@ def showhelp(): HelpStr.set(tips) LabText = ttk.Label(LabFrmText, textvariable=HelpStr,width=55) LabText.config(wraplength=350) - + def on_closing(): global windowflag windowflag = "close" diff --git a/uengine-launch.sh b/uengine-launch.sh new file mode 100755 index 0000000..27e1c9c --- /dev/null +++ b/uengine-launch.sh @@ -0,0 +1,25 @@ +#!/bin/bash +FILE=/usr/bin/uengine +if [ -f "$FILE" ]; then + echo "$FILE 存在,正常打开菜单" + /usr/bin/uengine launch --package=org.anbox.appmgr --component=org.anbox.appmgr.AppViewActivity +else + echo "$FILE 不存在,没有安装 UEngine,询问是否安装 UEngine" + # 读取系统版本 + version=`sed -n '/^NAME/s/NAME="//Ip' /etc/os-release | sed -n 's/\"//Ip'` + declare -l versionLower=$version + echo "系统:$version" + if [ "$versionLower" = "deepin" ] || [ "$versionLower" = "uos" ]; then + echo "此系统为 Deepin/UOS,使用 apt 安装" + zenity --question --text="您还未安装 UEngine,是否现在安装?" --no-wrap + if [[ $? = 0 ]]; then + deepin-terminal -C "pkexec apt install uengine" + fi + else + echo "非 Deepin/UOS 系统,使用 shenmo 提供的脚本安装" + zenity --question --text="您还未安装 UEngine,是否现在安装?\n将会使用 shenmo 提供的脚本进行安装" --no-wrap + if [[ $? = 0 ]]; then + deepin-terminal -C "bash /opt/apps/com.gitee.uengine.runner.spark/files/uengine-installer" + fi + fi +fi