修改DEBIAN/postinst

This commit is contained in:
2023-04-15 18:39:30 +08:00
parent 0a643cb808
commit c61607de13
55 changed files with 222 additions and 151 deletions

View File

@@ -22,6 +22,7 @@ import platform
import threading
import traceback
import webbrowser
import updatekiller
import subprocess
import req as requests
import urllib.parse as parse
@@ -380,14 +381,14 @@ def OpenUrl(url):
print(url.url())
# 判断是否可以使用小窗打开
if not bad:
Temp.webWindow = QtWidgets.QMainWindow()
'''Temp.webWindow = QtWidgets.QMainWindow()
web = QtWebEngineWidgets.QWebEngineView()
web.setUrl(url)
Temp.webWindow.setWindowTitle("浏览页面")
Temp.webWindow.setCentralWidget(web)
Temp.webWindow.setWindowIcon(QtGui.QIcon(iconPath))
Temp.webWindow.show()
return
return'''
webbrowser.open_new_tab(url.url())
#QtCore.QUrl().url()
@@ -1122,38 +1123,44 @@ class UpdateWindow():
updateWidgetLayout = QtWidgets.QGridLayout()
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本未知\n更新内容")
updateText = QtWidgets.QTextBrowser()
ok = QtWidgets.QPushButton(transla.transe("U", "更新(更新后需要自行手动重启程序)"))
updateText.anchorClicked.connect(OpenUrl)
updateText.setOpenExternalLinks(False)
ok = QtWidgets.QPushButton(transla.transe("U", "更新(更新时会自动关闭 Wine 运行器)"))
ok.clicked.connect(UpdateWindow.Update)
cancel = QtWidgets.QPushButton("取消")
cancel.clicked.connect(UpdateWindow.update.close)
if "从源码运行的版本" == programVersionType:
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本未知从源码运行不提供更新\n更新内容")
updateText.setText("从源码运行不提供更新")
ok.setDisabled(True)
else:
if 1 == 0:
url = ""
else:
if "deepin/UOS 应用商店版本<带签名>" == programVersionType:
url = "aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci11cGRhdGUtaW5mb3JtYXRpb24vcmF3L2JyYW5jaC9tYXN0ZXIvdXBkYXRlLXVvcy5qc29u"
elif "星火应用商店版本" == programVersionType:
url = "aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci11cGRhdGUtaW5mb3JtYXRpb24vcmF3L2JyYW5jaC9tYXN0ZXIvdXBkYXRlLXNwYXJrLmpzb24="
else:
url = "aHR0cHM6Ly9jb2RlLmdpdGxpbmsub3JnLmNuL2dmZGdkLXhpLW9yZy93aW5lLXJ1bm5lci11cGRhdGUtaW5mb3JtYXRpb24vcmF3L2JyYW5jaC9tYXN0ZXIvdXBkYXRlLmpzb24="
try:
UpdateWindow.data = json.loads(requests.get(base64.b64decode(url).decode("utf-8")).text)
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本{UpdateWindow.data['Version']}\n更新内容")
if UpdateWindow.data["Version"] == version:
updateText.setText(transla.transe("U", "此为最新版本,无需更新"))
ok.setDisabled(True)
else:
updateText.setText(UpdateWindow.data["New"].replace("\\n", "\n"))
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(updateWidget, transla.transe("U", "错误"), transla.transe("U", "无法连接服务器!"))
updateText.setText("无法连接服务器,无法更新")
url = "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-update-information/raw/branch/master/update.json"
try:
UpdateWindow.data = json.loads(requests.get(url).text)
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本{UpdateWindow.data['Version']}\n更新内容")
if UpdateWindow.data["Version"] == version:
updateText.setText("此为最新版本,无需更新")
ok.setDisabled(True)
else:
# 版本号读取(防止出现高版本号提示要“升级”到低版本号的问题)
localVersionList = version.split(".")
webVersionList = UpdateWindow.data['Version'].split(".")
for i in range(len(localVersionList)):
local = int(localVersionList[i])
web = int(webVersionList[i])
if web < local:
updateText.setHtml(f"""<p>此为最新版本,无需更新,但似乎您当前使用的程序版本比云端版本还要高。</p>
<p>出现这个问题可能会有如下几种情况:</p>
<p>1、使用编译或者内测版本</p>
<p>2、自己修改了程序版本</p>
<p>3、作者忘记更新云端上的更新信息了</p>
<p>如果是第三种情况,请反馈到此:<a href='https://gitee.com/gfdgd-xi/deep-wine-runner/issues/I6T3FG'>https://gitee.com/gfdgd-xi/deep-wine-runner/issues/I6T3FG</a></p>
<p><img src='{programPath}/Icon/doge.png'></p>""")
ok.setDisabled(True)
break
if web > local:
updateText.setText(UpdateWindow.data["New"].replace("\\n", "\n"))
ok.setEnabled(True)
break
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(updateWidget, "错误", "无法连接服务器!")
updateWidgetLayout.addWidget(versionLabel, 0, 0, 1, 1)
updateWidgetLayout.addWidget(updateText, 1, 0, 1, 3)
updateWidgetLayout.addWidget(ok, 2, 2, 1, 1)
@@ -1173,8 +1180,8 @@ class UpdateWindow():
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
echo 删除多余的安装包
rm -rfv /tmp/spark-deepin-wine-runner/update/*
#echo 关闭“Wine 运行器”以及其它“Python 应用”
#killall python3
echo 关闭“Wine 运行器”
python3 "{programPath}/updatekiller.py"
echo 下载安装包
wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0]}
echo 安装安装包
@@ -2197,6 +2204,7 @@ try:
"deepin-wine6 stable": "deepin-wine6-stable",
"deepin-wine5 stable": "deepin-wine5-stable",
"spark-wine7-devel": "spark-wine7-devel",
"spark-wine8": "spark-wine8",
"deepin-wine": "deepin-wine",
"deepin-wine5": "deepin-wine5",
"wine": "wine",
@@ -2399,23 +2407,9 @@ exe路径\' 参数 \'
<b>千万不要中断后不删除源的情况下 apt upgrade </b>中断后只需重新打开脚本输入 repair 或者随意安装一个 Wine会自动执行恢复操作即可
以及此脚本安装的 Wine 无法保证 100% 能使用,以及副作用是会提示;
<code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。</code>''')
updateThingsString = transla.transe("U", '''※1、Windows 应用适配工具新增系统资源显示
※2、Windows 应用适配工具使用 C++ 重写
3、修复打包器(基于官方生态适配脚本)无法打开的问题
※4、新增运行库功能安装以实现使用 Qemu User 跨架构运行 Wine 的功能(理论上支持 3a4000 了,但没试过);
※5、修复 Chroot 容器的一些问题;
※6、修复在 Debian11 安装时缺失依赖 rar 的问题;
※7、新增安装 box86、box64 的功能;
※8、修复故障反馈功能错误的问题
※9、支持调用 Flatpak 安装的 Wine
10、修改程序内的部分网址
11、作者信息变更
12、支持禁用程序的多语言支持默认禁用因为是机翻的
13、支持在程序本地翻译缺失的情况下自动机翻缺失语句
14、从此版本开始不再区分吾爱版、Spark 版和 UOS 版;
15、新增下载量查询
16、更新程序公告
17、新增断网彩蛋。
updateThingsString = transla.transe("U", '''※1、Windows 虚拟机安装工具支持非 X86 架构
※2、应用打包器可以与星火应用商店配合构建 arm/all 全架构的 Wine 包
3、运行器和打包器支持调用 spark-wine8
''')
for i in information["Thank"]:
thankText += f"{i}\n"
@@ -2437,6 +2431,7 @@ a:link, a:active {{
版本:{version}
适用平台:{goodRunSystem}@VersionForType@
安装包构建时间:{information['Time']}
Qt 版本:{QtCore.qVersion()}
程序官网:{programUrl}
当前程序占用体积:@programSize@MB</pre>
@@ -2624,7 +2619,7 @@ mainLayout.setColumnStretch(1, 1)
mainLayout.addWidget(returnText, 0, 1, 2, 1)
# 版权
copy = QtWidgets.QLabel(f"""\n程序版本{version}<b>提示Wine 无法运行保证可以运行所有的 Windows 程序,如果想要运行更多可执行程序,可以考虑虚拟机和双系统</b><br>
copy = QtWidgets.QLabel(f"""\n程序版本{version}<b>提示Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统</b><br>
©2020~{time.strftime("%Y")} gfdgd xi、为什么您不喜欢熊出没和阿布呢""")
mainLayout.addWidget(copy, 2, 0, 1, 1)
@@ -2937,7 +2932,7 @@ def AddLib(install: QtWidgets.QAction, uninstall, menu, info):
menu.addAction(uninstall)
if os.path.exists(f"{programPath}/InstallRuntime"):
installLib = menu.addMenu(transla.transe("U", "运行库"))
installLib = menu.addMenu(transla.transe("U", "运行库(&R)"))
installQemuMenu = installLib.addMenu(transla.transe("U", "安装 Qemu User"))
installQemu = QtWidgets.QAction("安装 Qemu User")
removeQemu = QtWidgets.QAction("卸载 Qemu User")