2.1.0完成

This commit is contained in:
2022-08-26 14:41:08 +08:00
parent 1a453c6778
commit 8149ea0e8d
30 changed files with 1351 additions and 250 deletions

View File

@@ -26,8 +26,6 @@ import urllib.parse as parse
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
# 方便一些,单独把 tr 抽出来
from PyQt5.QtCore import QObject
###################
# 程序所需事件
###################
@@ -122,6 +120,7 @@ def DisableButton(things):
e1.setDisabled(things)
e2.setDisabled(things)
o1.setDisabled(things)
miniAppStore.setDisabled(things)
#winetricksOpen.configure(state=a[things])
getProgramIcon.setDisabled(things)
uninstallProgram.setDisabled(things)
@@ -516,6 +515,20 @@ def FontAppStore():
wineBottonPath = e1.currentText()
os.system(f"WINE='{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallFont.py' '{wineBottonPath}' {int(setting['RuntimeCache'])}")
def GetDllFromInternet():
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
os.system(f"WINE='{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallDll.py' '{wineBottonPath}' '{wine[o1.currentText()]}' {int(setting['RuntimeCache'])}")
def WineBottonAutoConfig():
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
os.system(f"'{programPath}/AutoConfig.py' '{wine[o1.currentText()]}' '{wineBottonPath}'")
def InstallMonoGecko(program):
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
@@ -556,7 +569,7 @@ def InstallDXVK():
wineBottonPath = e1.currentText()
process = QtCore.QProcess()
process.startDetached(f"{programPath}/launch.sh", ["deepin-terminal", "-e",
"env", f"WINE={wine[o1.currentText()]}", f"WINE64={wine[o1.currentText()]}", f"WINEPREFIX={wineBottonPath}",
"env", f"WINE={wine[o1.currentText()]}", f"WINE64={wine[o1.currentText()]}", f"WINEPREFIX={wineBottonPath}", "bash",
f"{programPath}/dxvk/setup_dxvk.sh", "install"])
def UninstallDXVK():
@@ -647,7 +660,15 @@ def ThankWindow():
about_this_program()
def InstallWineFont():
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'echo 这些字体来自星火应用商店 && sudo ss-apt-fast install ms-core-fonts winfonts -y' --keep-open"]).start()
# 筛选 apt
if not os.system("which aptss"):
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'echo 这些字体来自星火应用商店 && sudo aptss install ms-core-fonts -y' --keep-open"]).start()
elif not os.system("which ss-apt-fast"):
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'echo 这些字体来自星火应用商店 && sudo ss-apt-fast update && sudo ss-apt-fast install ms-core-fonts -y' --keep-open"]).start()
elif not os.system("which apt-fast"):
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'echo 这些字体来自星火应用商店 && sudo apt-fast install ms-core-fonts -y' --keep-open"]).start()
else:
threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -C 'echo 这些字体来自星火应用商店 && sudo apt install ms-core-fonts -y' --keep-open"]).start()
def WineRunnerBugUpload():
threading.Thread(target=os.system, args=[f"'{programPath}/deepin-wine-runner-update-bug'"]).start()
@@ -932,6 +953,7 @@ class GetDllFromWindowsISO:
return
try:
shutil.copy(f"/tmp/wine-runner-getdll/i386/{choose[:-1]}_", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
os.system(f"WINEPREFIX='{GetDllFromWindowsISO.wineBottonPath}' '{wine[o1.currentText()]}' reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(choose)[0]} /d native /f")
QtWidgets.QMessageBox.information(GetDllFromWindowsISO.message, "提示", "提取成功!")
except:
traceback.print_exc()
@@ -1340,15 +1362,20 @@ exe路径\' 参数 \'
<code>N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。</code>'''
updateThingsString = '''<b>※1、新增新的 Wine 安装器,并支持将安装的 Wine 打包到 Wine 程序 deb 包中
※2、Wine 打包器打包 Windows 应用支持将 Wine 打包入 deb 内,可以不依赖 Wine一般不推荐把 Wine 打包入内,推荐用依赖的形式),并支持设置自定义依赖和生成模板
※3、开始初步多语言支持</b>
4、修改错别字(图形话=>图形化)
5、修复评分功能名称为空也可以上传评分的问题
6、去除 toilet 依赖,使在 Deepin 23 Preview 上运行更佳
7、支持删除所有由 Wine 创建的启动器快捷方式
※3、开始初步多语言支持
4、修复了在没有安装任何 Wine 的情况下使用高级功能导致程序闪退的问题
5、支持云端自动获取数据配置 Wine 容器
6、支持手动导入配置文件自动配置 Wine 容器
7、新增从云端下载 Dll 的功能
※8、修复了 Dll 提取工具不会在 winecfg 中添加原装的问题</b>
9、修改错别字图形话=>图形化)
10、修复评分功能名称为空也可以上传评分的问题
11、去除 toilet 依赖,使在 Deepin 23 Preview 上运行更佳
12、支持删除所有由 Wine 创建的启动器快捷方式
'''
for i in information["Thank"]:
thankText += f"{i}\n"
updateTime = "2022年08月22日"
updateTime = "2022年08月26日"
about = f'''<h1>关于</h1>
<p>一个能让Linux用户更加方便运行Windows应用的程序内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器、运行库安装工具等等</p>
<p>同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具可以做到只需要用户下载系统镜像并点击安装即可无需顾及虚拟机安装、创建、虚拟机的分区等等</p>
@@ -1494,6 +1521,9 @@ programManager.addWidget(button_r_6, 3, 4, 1, 1)
sparkWineSetting = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "星火wine配置"))
sparkWineSetting.clicked.connect(lambda: threading.Thread(target=os.system, args=["/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"]).start())
programManager.addWidget(sparkWineSetting, 3, 6, 1, 1)
wineAutoConfig = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "自动/手动配置 Wine 容器"))
wineAutoConfig.clicked.connect(WineBottonAutoConfig)
programManager.addWidget(wineAutoConfig, 3, 8, 1, 1)
# 权重
button5.setSizePolicy(size)
saveDesktopFileOnLauncher.setSizePolicy(size)
@@ -1575,6 +1605,7 @@ w4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "删除选择的 W
cleanBottonUOS = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "清理 Wine 容器(基于 Wine 适配活动脚本)"))
w5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "打包 wine 应用"))
w6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用官方 Wine 适配活动的脚本进行打包"))
getDllOnInternet = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从互联网获取DLL"))
w7 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从镜像获取DLL只支持Windows XP、Windows Server 2003官方安装镜像"))
updateGeek = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "从 Geek Uninstaller 官网升级程序"))
deleteDesktopIcon = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "删除所有 Wine 程序在启动器的快捷方式"))
@@ -1587,6 +1618,7 @@ wineOption.addSeparator()
wineOption.addAction(w5)
wineOption.addAction(w6)
wineOption.addSeparator()
wineOption.addAction(getDllOnInternet)
wineOption.addAction(w7)
wineOption.addSeparator()
wineOption.addAction(updateGeek)
@@ -1652,6 +1684,7 @@ w4.triggered.connect(DeleteWineBotton)
cleanBottonUOS.triggered.connect(CleanWineBottonByUOS)
w5.triggered.connect(BuildExeDeb)
w6.triggered.connect(UOSPackageScript)
getDllOnInternet.triggered.connect(GetDllFromInternet)
w7.triggered.connect(GetDllFromWindowsISO.ShowWindow)
updateGeek.triggered.connect(lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C '\"{programPath}/UpdateGeek.sh\"' --keep-open"))
w8.triggered.connect(SetDeepinFileDialogDeepin)
@@ -1695,7 +1728,7 @@ s2.triggered.connect(lambda: webbrowser.open_new_tab("https://s.threatbook.cn/")
s3.triggered.connect(lambda: webbrowser.open_new_tab("https://www.virustotal.com/"))
help = menu.addMenu(QtCore.QCoreApplication.translate("U", "帮助(&H)"))
h1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "程序官网"))
h1 = help.addMenu(QtCore.QCoreApplication.translate("U", "程序官网"))
h2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "小提示"))
h3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新内容"))
h4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "谢明名单"))
@@ -1703,12 +1736,29 @@ h5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新这个程
h6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "反馈这个程序的建议和问题"))
h7 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "关于这个程序"))
h8 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "关于 Qt"))
help.addAction(h1)
gfdgdxiio = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "作者个人站"))
gitee = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Gitee"))
github = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Github"))
gitlink = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Gitlink"))
gitlab = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Gitlab"))
jihu = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "极狐"))
h1.addAction(gfdgdxiio)
h1.addAction(gitee)
h1.addAction(github)
h1.addAction(gitlink)
h1.addAction(gitlab)
h1.addAction(jihu)
help.addSeparator()
help.addAction(h2)
help.addAction(h3)
help.addAction(h4)
help.addSeparator()
videoHelp = help.addMenu(QtCore.QCoreApplication.translate("U", "视频教程"))
easyHelp = QtWidgets.QAction("简易使用教程")
buildHelp = QtWidgets.QAction("打包教程")
videoHelp.addAction(easyHelp)
videoHelp.addAction(buildHelp)
help.addSeparator()
help.addAction(h5)
help.addAction(h6)
help.addAction(h7)
@@ -1717,10 +1767,17 @@ help.addSeparator()
hm1 = help.addMenu(QtCore.QCoreApplication.translate("U", "更多生态适配应用"))
hm1_1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "运行 Android 应用UEngine 运行器"))
hm1.addAction(hm1_1)
h1.triggered.connect(OpenProgramURL)
gfdgdxiio.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io"))
gitee.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/deep-wine-runner"))
github.triggered.connect(lambda: webbrowser.open_new_tab("https://github.com/gfdgd-xi/deep-wine-runner"))
gitlink.triggered.connect(lambda: webbrowser.open_new_tab("https://gitlink.org.cn/gfdgd_xi/deep-wine-runner"))
gitlab.triggered.connect(lambda: webbrowser.open_new_tab("https://gitlab.com/gfdgd-xi/deep-wine-runner"))
jihu.triggered.connect(lambda: webbrowser.open_new_tab("https://jihulab.com//gfdgd-xi/deep-wine-runner"))
h2.triggered.connect(helps)
h3.triggered.connect(UpdateThings)
h4.triggered.connect(ThankWindow)
easyHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://www.bilibili.com/video/BV1ma411972Y"))
buildHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://www.bilibili.com/video/BV1EU4y1k7zr"))
h5.triggered.connect(UpdateWindow.ShowWindow)
h6.triggered.connect(WineRunnerBugUpload)
h7.triggered.connect(about_this_program)
@@ -1772,6 +1829,10 @@ if len(sys.argv) > 1 and sys.argv[1]:
e2.setEditText(sys.argv[1])
if not os.path.exists("/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"):
sparkWineSetting.setEnabled(False)
#ProgramRunStatusShow.ShowWindow()
#ProgramRunStatusUpload.ShowWindow()
if o1.currentText() == "":
# 一个 Wine 都没有却用 Wine 的功能
# 还是要处理的,至少不会闪退
wine["没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用"] = "没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用"
canUseWine.append("没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用")
o1.addItem("没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用")
sys.exit(app.exec_())