diff --git a/README.md b/README.md index 69dc5e3..b0229ac 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# wine 运行器 1.5.3 +# wine 运行器 1.6.0 ## 介绍 一个图形化了以下命令的程序 @@ -9,7 +9,7 @@ env WINEPREFIX=容器路径 wine(wine的路径) 可执行文件路径 是使用 Python3 的 tkinter 构建的 (自己美术功底太差,图标只能在网络上找了) (测试平台:deepin 20.6;UOS 家庭版 21;Ubuntu 22.04) -![Screenshot_20220707_215916.png](https://storage.deepin.org/thread/202207072207209350_Screenshot_20220707_215916.png) +![image.png](https://storage.deepin.org/thread/202207101734379289_image.png) 而打包器可以方便的把您的 wine 容器打包成 deb 包供他人使用,程序创建的 deb 构建临时文件夹目录树如下: ```bash /XXX @@ -60,14 +60,26 @@ exe路径\' 参数 \' 5、.desktop 的图标只支持 PNG 格式和 SVG 格式,其他格式无法显示图标 ## 更新日志 -### 1.5.3 +### 1.6.0(2022年07月10日) +**※1、新增程序感谢、谢明以及程序的建议和问题反馈和内置更新程序** +**※2、支持 winetricks 指定 Wine 打开** +**※3、新增窗口透明工具,感谢@a2035274 和 @虚幻的早晨 在论坛的讨论** +**※4、支持在指定容器、Wine 安装 MSXML** +**※5、支持启用/关闭 opengl(感谢@zhangs 在论坛发帖)以及支持安装/卸载 winbind** +**※6、添加云沙箱的网站链接快捷方式** +**※7、支持从星火应用商店源安装 Windows 常见字体** +8、优化窗口布局以及默认显示位置 +9、支持打开指定容器、Wine 的资源管理器 +![image.png](https://storage.deepin.org/thread/202207101734379289_image.png) + +### 1.5.3(2022年07月07日) **※1、新增专门的程序设置,支持设置 Wine 容器架构、DEBUG 信息是否输出、默认的 Wine、默认容器路径、是否使用终端打开和 Wine 参数** **※2、修复了 wine 打包器的控件禁用不全和打包的 deb 用户残留的问题** **※3、新增暗黑主题** 4、合并了 deepin wine 文管设置器 ![Screenshot_20220707_215916.png](https://storage.deepin.org/thread/202207072207209350_Screenshot_20220707_215916.png) -### 1.5.2 +### 1.5.2(2022年07月06日) **※1、添加并翻新了 deepin-wine5 打包器,改为 wine 打包器,支持常见 wine 的打包** **※2、新增 Visual Studio C++ 的安装程序** **※3、新增从系统安装镜像提取 DLL 到 wine 容器的功能(当前只支持 Windows XP 和 Windows Server 2003 的官方安装镜像)** @@ -78,7 +90,7 @@ exe路径\' 参数 \' ![image.png](https://storage.deepin.org/thread/202207061005251446_image.png) -### 1.5.1 +### 1.5.1(2022年07月04日) **※1、支持打开 spark-wine7-devel 的专门缩放设置(如未安装则此按钮禁用)** **※2、支持提取选择的 exe 文件的图标** **※3、支持向指定的 wine 容器安装 mono、gecko、.net framework(此功能在菜单栏“Wine”中,卸载只需要使用程序的卸载按钮打开 Geek Uninstaller 即可)** @@ -91,7 +103,7 @@ exe路径\' 参数 \' ![image.png](https://storage.deepin.org/thread/202207042234078682_image.png) -### 1.5.0 +### 1.5.0(2022年07月03日) **※1、支持显示 wine 程序运行时的返回内容** **※2、优化打包方式,减少从 pip 安装的库,并将 pip 源设为阿里源提升下载速度** **※3、新增 spark-wine7-devel** @@ -102,7 +114,7 @@ exe路径\' 参数 \' ![image.png](https://storage.deepin.org/thread/202207031902414162_image.png) -### 1.4.0 +### 1.4.0(2021年07月27日) **※1、修改了 wine 选项的说明和 wine 的启动方式;** **※2、设置了窗口主题;** **※3、修改了打包以及 .desktop 文件** @@ -113,7 +125,7 @@ exe路径\' 参数 \' 8、在 gitee/github 仓库上添加了 wine 安装脚本 ![](https://images.gitee.com/uploads/images/2021/0727/151226_750579c2_7896131.png) -### 1.3.1 +### 1.3.1(2021年05月23日) 1、添加了历史记录,使用更加方便 2、增加“更新内容”项 3、支持浏览窗口的默认路径为上次访问的路径 @@ -126,13 +138,13 @@ exe路径\' 参数 \' ![run](https://images.gitee.com/uploads/images/2021/0523/155654_90ceb8ce_7896131.png "截图录屏_选择区域_20210523153947.png") ![run](https://images.gitee.com/uploads/images/2021/0523/155702_66841e22_7896131.png "截图录屏_选择区域_20210523154007.png") -### 1.3.0 +### 1.3.0(2021年05月22日) 1. 修改了窗口显示控件的库(从 tkinter 到 tkinter.ttk) 2. 添加了更多 wine 可以选择(deepin-wine、deepin-wine5、wine、wine64、deepin-wine5-stable、deepin-wine6-stable) 3. 修改了程序的提示信息 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0522/175640_a592db4d_7896131.png "截图录屏_tk_20210522170529.png") -### 1.2.0 +### 1.2.0(2021年03月14日) 1. 修改布局方式 2. 轻度梳理代码布局 ![输入图片说明](https://images.gitee.com/uploads/images/2021/0314/181320_cb4cbf72_7896131.png "屏幕截图.png") @@ -140,15 +152,15 @@ exe路径\' 参数 \' ### 1.1.2 (未发布发行版) 1. 进行了细节优化 -### 1.1.1 +### 1.1.1(2021年01月31日) 1. 使用多线程,防止界面假死 2. 添加软件图标 ![](https://images.gitee.com/uploads/images/2021/0131/143557_40911a67_7896131.png) -### 1.1 +### 1.1.0(2021年01月29日) 1. 修改了代码的部分内容,使其支持容器路径可带空格无需“\”转义,以及支持手动保存运行脚本到桌面 -### 1.0 +### 1.0.0(2021年01月29日) 1. 实现内容 ## 更多 diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control index 89dab7d..97c30fb 100644 --- a/deb/DEBIAN/control +++ b/deb/DEBIAN/control @@ -9,9 +9,13 @@ Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer Description: gfdgd xi 制作的 wine 运行器 更新内容: - ※1、添加并翻新了 deepin-wine5 打包器,改为 wine 打包器,支持常见 wine 的打包 - ※2、新增 Visual Studio C++ 的安装程序 - ※3、新增从系统安装镜像提取 DLL 到 wine 容器的功能(当前只支持 Windows XP 和 Windows Server 2003 的官方安装镜像) - 4、修复了安装星火应用商店的 wine 运行器右键打开方式没有 wine 运行器选项的问题 - 5、新增脚本,优化 deepin terminal 调用本程序脚本显示不佳的问题 + ※1、新增程序感谢、谢明以及程序的建议和问题反馈和内置更新程序 + ※2、支持 winetricks 指定 Wine 打开 + ※3、新增窗口透明工具,感谢@a2035274 和 @虚幻的早晨 在论坛的讨论 + ※4、支持在指定容器、Wine 安装 MSXML + ※5、支持启用/关闭 opengl(感谢@zhangs 在论坛发帖)以及支持安装/卸载 winbind + ※6、添加云沙箱的网站链接快捷方式 + ※7、支持从星火应用商店源安装 Windows 常见字体 + 8、优化窗口布局以及默认显示位置 + 9、支持打开指定容器、Wine 的资源管理器 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 diff --git a/deb/DEBIAN/postinst b/deb/DEBIAN/postinst index 11fd17b..069e1a0 100755 --- a/deb/DEBIAN/postinst +++ b/deb/DEBIAN/postinst @@ -3,4 +3,4 @@ python3 -m pip install --upgrade ttkthemes -i http://mirrors.aliyun.com/pypi/ python3 -m pip install --upgrade ttkbootstrap -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com python3 -m pip install --upgrade easygui -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com # 向服务器返回安装数加1(不显示内容且忽略错误) -curl http://120.25.153.144/spark-deepin-wine-runner/Install.php?Version=1.5.3 -s > /dev/null | true +curl http://120.25.153.144/spark-deepin-wine-runner/Install.php?Version=1.6.0 -s > /dev/null | true diff --git a/deb/opt/apps/deepin-wine-runner/DisabledOpengl.reg b/deb/opt/apps/deepin-wine-runner/DisabledOpengl.reg new file mode 100644 index 0000000..868bd2a Binary files /dev/null and b/deb/opt/apps/deepin-wine-runner/DisabledOpengl.reg differ diff --git a/deb/opt/apps/deepin-wine-runner/EnabledOpengl.reg b/deb/opt/apps/deepin-wine-runner/EnabledOpengl.reg new file mode 100644 index 0000000..3a0d396 Binary files /dev/null and b/deb/opt/apps/deepin-wine-runner/EnabledOpengl.reg differ diff --git a/deb/opt/apps/deepin-wine-runner/InstallMsxml.py b/deb/opt/apps/deepin-wine-runner/InstallMsxml.py new file mode 100755 index 0000000..209ba87 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/InstallMsxml.py @@ -0,0 +1,41 @@ +#!/usr/bin/env python3 +import os +import sys + +if "--help" in sys.argv: + print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("版本:1.0.0") + print("本程序可以更方便的在 wine 容器中安装 MSXML") + sys.exit() +if len(sys.argv) <= 2 or sys.argv[1] == "" or sys.argv[2] == "": + print("您未指定需要安装 MSXML 的容器和使用的 wine,无法继续") + print("参数:") + print("XXX 参数一 参数二") + print("参数一为需要安装的容器,参数二为需要使用的wine,两个参数位置不能颠倒") + sys.exit() + +msxmlList = [ + ["MSXML 4.0 SP2", "https://www.gitlink.org.cn/api/attachments/390679?gfdgd_xi"], + ["MSXML 4.0 SP3", "https://www.gitlink.org.cn/api/attachments/390678?gfdgd_xi"], + ["MSXML 6.0", "https://www.gitlink.org.cn/api/attachments/390681?gfdgd_xi"] +] +print("请选择以下的 MSXML 进行安装(不保证能正常安装运行)") +for i in range(0, len(msxmlList)): + print(f"{i}、{msxmlList[i][0]}") +while True: + try: + choose = int(input("请输入要选择要安装的 MSXML:")) + except: + print("输入错误,请重新输入") + continue + if 0 <= choose and choose < len(msxmlList): + break +print(f"您选择了 {msxmlList[choose][0]}") +print("开始下载") +os.system("rm -rfv /tmp/wineinstallmsxml") +os.system("mkdir -p /tmp/wineinstallmsxml") +os.system(f"aria2c -x 16 -s 16 -d /tmp/wineinstallmsxml -o install.msi \"{msxmlList[choose][1]}\"") +print("开始安装") +os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i /tmp/wineinstallmsxml/install.msi") +print("安装结束") +sys.exit() \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/InstallOther.py b/deb/opt/apps/deepin-wine-runner/InstallOther.py new file mode 100644 index 0000000..59822a4 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/InstallOther.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python3 +import os +import sys + +if "--help" in sys.argv: + print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("版本:1.0.0") + print("本程序可以更方便的在 wine 容器中安装运行库") + sys.exit() +if len(sys.argv) <= 2 or sys.argv[1] == "" or sys.argv[2] == "": + print("您未指定需要安装的容器和使用的 wine,无法继续") + print("参数:") + print("XXX 参数一 参数二") + print("参数一为需要安装的容器,参数二为需要使用的wine,两个参数位置不能颠倒") + sys.exit() + +msxmlList = [ + ["Windows Script 5.7 for Windows XP", "https://download.microsoft.com/download/f/f/e/ffea3abf-b55f-4924-b5a5-bde0805ad67c/scripten.exe", "exe"], + ["Windows Management Instrumentation 1.50.1131", "https://www.gitlink.org.cn/api/attachments/390680", "exe"] +] +print("请选择以下的应用进行安装(不保证能正常安装运行)") +for i in range(0, len(msxmlList)): + print(f"{i}、{msxmlList[i][0]}") +while True: + try: + choose = int(input("请输入要选择要安装的应用:")) + except: + print("输入错误,请重新输入") + continue + if 0 <= choose and choose < len(msxmlList): + break +print(f"您选择了{msxmlList[choose][0]}") +print("开始下载") +os.system("rm -rf /tmp/wineinstall") +os.system("mkdir -p /tmp/wineinstall") +if msxmlList[choose][2] == "msi": + os.system(f"aria2c -x 16 -s 16 -d /tmp/wineinstall -o install.msi \"{msxmlList[choose][1]}\"") + print("开始安装") + os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i /tmp/wineinstall/install.msi") + print("安装结束") + sys.exit() +if msxmlList[choose][2] == "exe": + os.system(f"aria2c -x 16 -s 16 -d /tmp/wineinstall -o install.exe \"{msxmlList[choose][1]}\"") + print("开始安装") + os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineinstall/install.exe") + print("安装结束") + sys.exit() + pass \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-packager.py b/deb/opt/apps/deepin-wine-runner/deepin-wine-packager.py index 3c75032..27c6ea1 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-packager.py +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-packager.py @@ -1,14 +1,13 @@ #!/usr/bin/env python3 ######################################################################### # 作者:gfdgd xi、为什么您不喜欢熊出没和阿布 -# 版本:1.5.2 +# 版本:1.5.3 # 感谢:感谢 deepin-wine 团队,提供了 deepin-wine 给大家使用,让我能做这个程序 # 基于 Python3 的 tkinter 构建 ######################################################################### ################# # 引入所需的库 ################# -from cProfile import run import os import sys import json @@ -366,7 +365,7 @@ fi except: traceback.print_exc() messagebox.showerror(title="错误", message="程序出现错误,错误信息:\n{}".format(traceback.format_exc())) - label13_text_change("deb 包构建出现错误:{}".format(repr(e))) + label13_text_change("deb 包构建出现错误") chang_textbox1_things(traceback.format_exc()) disabled_or_NORMAL_all(True) diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index c9e3272..4553d7c 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -2,22 +2,21 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 -# 版本:1.5.3 -# 更新时间:2022年07月07日 +# 版本:1.6.0 +# 更新时间:2022年07月10日 # 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 # 基于 Python3 的 tkinter 构建 ########################################################################################### ################# # 引入所需的库 ################# -from asyncore import read -from email import message import os -from sqlite3 import TimeFromTicks import sys import time import json import shutil +import easygui +import requests import threading import traceback import ttkthemes @@ -100,9 +99,10 @@ def DisableButton(things): e1.configure(state=a[things]) e2.configure(state=a[things]) o1.configure(state=a[things]) - winetricksOpen.configure(state=a[things]) + #winetricksOpen.configure(state=a[things]) getProgramIcon.configure(state=a[things]) uninstallProgram.configure(state=a[things]) + trasButton.configure(state=a[things]) def CheckProgramIsInstall(program): return not bool(os.system(f"which '{program}'")) @@ -361,9 +361,10 @@ def RunWinetricks(): if not setting["Debug"]: option += "WINEDEBUG=-all " if setting["TerminalOpen"]: - res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + option + wineBottonPath + "' winetricks\""], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='{wineBottonPath}' {option} WINE=" + subprocess.getoutput(f"which {wine[o1_text.get()]}").replace(" ", "").replace("\n", "") + " winetricks --gui\" --keep-open"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: - res = subprocess.Popen(["WINEPREFIX='" + option + wineBottonPath + "' winetricks"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + res = subprocess.Popen([f"WINEPREFIX='{wineBottonPath}' {option} WINE='" + subprocess.getoutput(f"which {wine[o1_text.get()]}").replace(" ", "").replace("\n", "") + "' winetricks --gui"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + #res = subprocess.Popen(["WINEPREFIX='" + option + wineBottonPath + "' winetricks"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # 清空文本框内容 returnText.config(state=tk.NORMAL) returnText.delete(1.0, "end") @@ -407,6 +408,24 @@ def InstallVisualStudioCPlusPlus(): os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"'{programPath}/InstallVisualCPlusPlus.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open") DisableButton(False) +def InstallMSXML(): + DisableButton(True) + if e1.get() == "": + wineBottonPath = setting["DefultBotton"] + else: + wineBottonPath = e1.get() + os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"'{programPath}/InstallMsxml.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open") + DisableButton(False) + +def InstallOther(): + DisableButton(True) + if e1.get() == "": + wineBottonPath = setting["DefultBotton"] + else: + wineBottonPath = e1.get() + os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"'{programPath}/InstallOther.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open") + DisableButton(False) + def BuildExeDeb(): if e1.get() == "": wineBottonPath = setting["DefultBotton"] @@ -447,6 +466,68 @@ def DeleteWineBotton(): traceback.print_exc() tkinter.messagebox.showerror(title="错误", message=traceback.format_exc()) +def ThankWindow(): + easygui.textbox(title="特别谢明", msg="感谢以下的大佬在 deepin 论坛、公众号等平台提供的 Wine 适配解决方案,现在将这些 Wine 适配方案加入此 Wine 运行器,对此有由衷的感谢!如果有侵犯到您的权利和意愿,请尽快与开发者联系删除在此程序内相关的内容:", text=thankText) + +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() + +def WineRunnerBugUpload(): + threading.Thread(target=os.system, args=[programPath + "/deepin-wine-runner-update-bug"]).start() + +class UpdateWindow(): + data = {} + def ShowWindow(): + update = tk.Toplevel() + update.title("检查更新") + update.resizable(0, 0) + update.iconphoto(False, tk.PhotoImage(file=iconPath)) + versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:未知\n更新内容:".format(version)) + updateText = tk.Text(update) + controlFrame = ttk.Frame(update) + ok = ttk.Button(controlFrame, text="更新(更新过程中会关闭所有Python应用,包括这个应用)", command=UpdateWindow.Update) + cancel = ttk.Button(controlFrame, text="取消", command=update.destroy) + try: + UpdateWindow.data = json.loads(requests.get("http://120.25.153.144/spark-deepin-wine-runner/update.json").text) + versionLabel = ttk.Label(update, text="当前版本:{}\n最新版本:{}\n更新内容:".format(version, UpdateWindow.data["Version"])) + if UpdateWindow.data["Version"] == version: + updateText.insert("0.0", "此为最新版本,无需更新") + ok.configure(state=tk.DISABLED) + else: + updateText.insert("0.0", UpdateWindow.data["New"].replace("\\n", "\n")) + except: + traceback.print_exc() + tkinter.messagebox.showerror(title="错误", message="无法连接服务器!") + updateText.configure(state=tk.DISABLED) + versionLabel.pack(anchor=tk.W) + updateText.pack() + controlFrame.pack(anchor=tk.E) + cancel.grid(row=0, column=0) + ok.grid(row=0, column=1) + update.mainloop() + def Update(): + if not os.path.exists("/tmp/uengine-runner/update"): + os.makedirs("/tmp/spark-deepin-wine-runner/update") + try: + write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash +echo 删除多余的安装包 +rm -rfv /tmp/spark-deepin-wine-runner/update/* +echo 关闭“UEngine 运行器”以及其它“Python 应用” +killall python3 +echo 下载安装包 +wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url"][0], iconPath} +echo 安装安装包 +dpkg -i /tmp/spark-deepin-wine-runner/update/*.deb +echo 修复依赖关系 +apt install -f -y +notify-send -i "{iconPath}" "更新完毕!" +zenity --info --text=\"更新完毕!\" --ellipsize +""") + except: + traceback.print_exc() + easygui.textbox(title="错误", msg="更新出现错误,无法继续更新!", text=traceback.format_exc()) + os.system(f"'{programPath}/launch.sh' deepin-terminal -e pkexec bash /tmp/spark-deepin-wine-runner/update.sh") + class GetDllFromWindowsISO: wineBottonPath = get_home() + "/.wine" isoPath = None#ttk.Entry() @@ -626,6 +707,7 @@ class ProgramSetting(): defultBotton = None terminalOpen = None wineOption = None + wineBottonDifferent = None def ShowWindow(): message = tk.Toplevel() ProgramSetting.wineBottonA = tk.StringVar() @@ -650,6 +732,10 @@ class ProgramSetting(): ttk.Label(message, text="自定义 wine 参数:").grid(row=5, column=0) ProgramSetting.wineOption = tk.StringVar() ProgramSetting.wineOption.set(setting["WineOption"]) + #ttk.Label(message, text="容器创建规则:").grid(row=6, column=0) + #ProgramSetting.wineBottonDifferent = tk.IntVar() + #ProgramSetting.wineBottonDifferent.set(setting["WineBottonDifferent"]) + ttk.Checkbutton(message, text="为每一个可执行文件创建单独的容器(如果勾选的话,上面默认 Wine 容器选项将会指定这些产生的 Wine 容器默认存放目录)", variable=ProgramSetting.wineBottonDifferent) ttk.Entry(message, width=40, textvariable=ProgramSetting.wineOption).grid(row=5, column=1, columnspan=2) ttk.Button(message, text="保存", command=ProgramSetting.Save).grid(row=6, column=0, columnspan=3, sticky=tk.E) # 设置 @@ -671,6 +757,7 @@ class ProgramSetting(): setting["DefultBotton"] = ProgramSetting.defultBotton.get() setting["TerminalOpen"] = bool(ProgramSetting.terminalOpen.get()) setting["WineOption"] = ProgramSetting.wineOption.get() + setting["WineBottonDifferent"] = bool(ProgramSetting.wineBottonDifferent.get()) try: write_txt(get_home() + "/.config/deepin-wine-runner/WineSetting.json", json.dumps(setting)) except: @@ -688,7 +775,8 @@ defultProgramList = { "DefultWine": "deepin-wine6 stable", "DefultBotton" : get_home() + "/.wine", "TerminalOpen": False, - "WineOption": "" + "WineOption": "", + "WineBottonDifferent": False } if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹 os.mkdir(get_home() + "/.config/deepin-wine-runner") # 创建配置文件夹 @@ -724,7 +812,7 @@ try: isoPathFound = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/ISOPathFound.json")).values()) setting = json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/WineSetting.json")) change = False - for i in ["Architecture", "Debug", "DefultWine", "DefultBotton", "TerminalOpen", "WineOption"]: + for i in ["Architecture", "Debug", "DefultWine", "DefultBotton", "TerminalOpen", "WineOption", "WineBottonDifferent"]: if not i in setting: change = True setting[i] = defultProgramList[i] @@ -759,13 +847,22 @@ tips = '''提示: exe路径\' 参数 \' 即可(单引号需要输入) 5、wine 容器如果没有指定,则会默认为 ~/.wine''' -updateThingsString = '''※1、新增专门的程序设置,支持设置 Wine 容器架构、DEBUG 信息是否输出、默认的 Wine、默认容器路径、是否使用终端打开和 Wine 参数 -※2、修复了 wine 打包器的控件禁用不全和打包的 deb 用户残留的问题 -※3、新增暗黑主题 -4、合并了 deepin wine 文管设置器''' +updateThingsString = '''※1、新增程序感谢、谢明以及程序的建议和问题反馈和内置更新程序 +※2、支持 winetricks 指定 Wine 打开 +※3、新增窗口透明工具,感谢@a2035274 和 @虚幻的早晨 在论坛的讨论 +※4、支持在指定容器、Wine 安装 MSXML +※5、支持启用/关闭 opengl(感谢@zhangs 在论坛发帖)以及支持安装/卸载 winbind +※6、添加云沙箱的网站链接快捷方式 +※7、支持从星火应用商店源安装 Windows 常见字体 +8、优化窗口布局以及默认显示位置 +9、支持打开指定容器、Wine 的资源管理器 +''' title = "wine 运行器 {}".format(version) -updateTime = "2022年07月07日" +updateTime = "2022年07月10日" updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y")) +thankText = "" +for i in information["Thank"]: + thankText += f"{i}\n" ########################### @@ -798,13 +895,14 @@ button1 = ttk.Button(window, text="浏览", command=liulanbutton) # 创建按 button2 = ttk.Button(window, text="浏览", command=liulanexebutton) # 创建按钮控件 button3 = ttk.Button(controlFrame, text="启动", command=runexebutton) # 创建按钮控件 killProgram = ttk.Button(controlFrame, text="停止", command=KillProgram) -openWineBotton = ttk.Button(controlFrame, text="打开Wine容器目录", command=OpenWineBotton) -installWineFont = ttk.Button(controlFrame, text="安装字体", command=OpenWineFontPath) +#openWineBotton = ttk.Button(controlFrame, text="打开Wine容器目录", command=OpenWineBotton) +#installWineFont = ttk.Button(controlFrame, text="安装字体", command=OpenWineFontPath) uninstallProgram = ttk.Button(controlFrame, text="卸载程序", command=UninstallProgram) wineConfig = ttk.Button(controlFrame, text="配置wine容器", command=ConfigWineBotton) sparkWineSetting = ttk.Button(controlFrame, text="星火wine设置", command=lambda: threading.Thread(target=os.system, args=["/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"]).start()) getProgramIcon = ttk.Button(controlFrame, text="获取选择的程序图标", command=lambda: threading.Thread(target=RunWineProgram, args=[f"{programPath}/Run.bat' '{programPath}/BeCyIconGrabber.exe' '{e2.get()}"]).start()) -winetricksOpen = ttk.Button(controlFrame, text="使用winetricks打开指定容器(只能使用wine和wine64)", command=lambda: threading.Thread(target=RunWinetricks).start()) +trasButton = ttk.Button(controlFrame, text="窗口透明度工具", command=lambda: threading.Thread(target=RunWineProgram, args=[programPath + "/窗体透明度设置工具.exe"]).start()) +#winetricksOpen = ttk.Button(controlFrame, text="使用winetricks打开指定容器(只能使用wine和wine64)", command=lambda: threading.Thread(target=RunWinetricks).start()) button5 = ttk.Button(sendFrame, text="创建用于运行的 desktop 文件到桌面", command=make_desktop_on_desktop) # 创建按钮控件 saveDesktopFileOnLauncher = ttk.Button(sendFrame, text="创建用于运行的 desktop 文件到启动器", command=make_desktop_on_launcher) # 创建按钮控件 label1 = ttk.Label(window, text="选择你想要使用的 wine 容器:") # 创建标签控件 @@ -827,32 +925,60 @@ programmenu.add_separator() # 设置分界线 programmenu.add_command(label="退出程序", command=window.quit) # 设置“退出程序”项 wineOption = tk.Menu(menu, tearoff=0, background="white") # 设置“Wine”菜单栏 menu.add_cascade(label="Wine", menu=wineOption) +wineOption.add_command(label="打开 Wine 容器目录", command=OpenWineBotton) +wineOption.add_command(label="安装常见字体", command=InstallWineFont) +wineOption.add_command(label="安装自定义字体", command=OpenWineFontPath) +wineOption.add_command(label="删除选择的 Wine 容器", command=DeleteWineBotton) +wineOption.add_separator() wineOption.add_command(label="打包 wine 应用", command=BuildExeDeb) wineOption.add_separator() wineOption.add_command(label="从镜像获取DLL(只支持Windows XP、Windows Server 2003官方安装镜像)", command=GetDllFromWindowsISO.ShowWindow) wineOption.add_separator() wineOption.add_command(label="在指定wine、指定容器安装 .net framework", command=lambda: threading.Thread(target=InstallNetFramework).start()) wineOption.add_command(label="在指定wine、指定容器安装 Visual Studio C++", command=lambda: threading.Thread(target=InstallVisualStudioCPlusPlus).start()) +wineOption.add_command(label="在指定wine、指定容器安装 MSXML", command=lambda: threading.Thread(target=InstallMSXML).start()) wineOption.add_command(label="在指定wine、指定容器安装 gecko", command=lambda: threading.Thread(target=InstallMonoGecko, args=["gecko"]).start()) wineOption.add_command(label="在指定wine、指定容器安装 mono", command=lambda: threading.Thread(target=InstallMonoGecko, args=["mono"]).start()) +wineOption.add_command(label="在指定wine、指定容器安装其它运行库", command=lambda: threading.Thread(target=InstallOther).start()) wineOption.add_separator() wineOption.add_command(label="打开指定wine、指定容器的控制面板", command=lambda: threading.Thread(target=RunWineProgram, args=["control"]).start()) wineOption.add_command(label="打开指定wine、指定容器的浏览器", command=lambda: threading.Thread(target=RunWineProgram, args=["iexplore' 'https://www.deepin.org"]).start()) wineOption.add_command(label="打开指定wine、指定容器的注册表", command=lambda: threading.Thread(target=RunWineProgram, args=["regedit"]).start()) wineOption.add_command(label="打开指定wine、指定容器的任务管理器", command=lambda: threading.Thread(target=RunWineProgram, args=["taskmgr"]).start()) +wineOption.add_command(label="打开指定wine、指定容器的资源管理器", command=lambda: threading.Thread(target=RunWineProgram, args=["explorer"]).start()) wineOption.add_command(label="打开指定wine、指定容器的关于 wine", command=lambda: threading.Thread(target=RunWineProgram, args=["winver"]).start()) wineOption.add_separator() wineOption.add_command(label="设置 run_v3.sh 的文管为 Deepin 默认文管", command=SetDeepinFileDialogDeepin) wineOption.add_command(label="设置 run_v3.sh 的文管为 Wine 默认文管", command=SetDeepinFileDialogDefult) wineOption.add_command(label="重新安装 deepin-wine-helper", command=SetDeepinFileDialogRecovery) wineOption.add_separator() -wineOption.add_command(label="删除选择的 wine 容器", command=DeleteWineBotton) +wineOption.add_command(label="使用winetricks打开指定容器", command=lambda: threading.Thread(target=RunWinetricks).start()) +wineOption.add_separator() +opengl = tk.Menu() +opengl.add_command(label="开启 opengl", command=lambda: threading.Thread(target=RunWineProgram, args=[f"regedit.exe' /s '{programPath}/EnabledOpengl.reg"]).start()) +opengl.add_command(label="禁用 opengl", command=lambda: threading.Thread(target=RunWineProgram, args=[f"regedit.exe' /s '{programPath}/DisabledOpengl.reg"]).start()) +wineOption.add_cascade(label="启用/禁用 opengl", menu=opengl) +winbind = tk.Menu() +winbind.add_command(label="安装 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt install winbind -y' --keep-open")) +winbind.add_command(label="卸载 winbind", command=lambda: os.system(f"'{programPath}/launch.sh' deepin-terminal -C 'pkexec apt purge winbind -y' --keep-open")) +wineOption.add_cascade(label="安装/卸载 winbind", menu=winbind) +safeWebsize = tk.Menu(menu, tearoff=0, background="white") +menu.add_cascade(label="云沙箱", menu=safeWebsize) +safeWebsize.add_command(label="360 沙箱云", command=lambda: webbrowser.open_new_tab("https://ata.360.net/")) +safeWebsize.add_command(label="微步云沙箱", command=lambda: webbrowser.open_new_tab("https://s.threatbook.cn/")) +safeWebsize.add_command(label="VIRUSTOTAL", command=lambda: webbrowser.open_new_tab("https://www.virustotal.com/")) + help = tk.Menu(menu, tearoff=0, background="white") # 设置“帮助”菜单栏 + menu.add_cascade(label="帮助", menu=help) help.add_command(label="程序官网", command=OpenProgramURL) # 设置“程序官网”项 help.add_separator() help.add_command(label="小提示", command=helps) # 设置“小提示”项 help.add_command(label="更新内容", command=UpdateThings) # 设置“更新内容”项 +help.add_command(label="谢明名单", command=ThankWindow) +help.add_separator() +help.add_command(label="更新这个程序", command=UpdateWindow.ShowWindow) +help.add_command(label="反馈这个程序的建议和问题", command=WineRunnerBugUpload) help.add_command(label="关于这个程序", command=about_this_program) # 设置“关于这个程序”项 help.add_separator() moreProgram = tk.Menu(menu, tearoff=0, background="white") @@ -890,13 +1016,14 @@ button2.grid(row=1, column=2) controlFrame.grid(row=3, column=0, columnspan=3) button3.grid(row=0, column=0) killProgram.grid(row=0, column=1) -openWineBotton.grid(row=0, column=2) -installWineFont.grid(row=0, column=3) -uninstallProgram.grid(row=0, column=4) -wineConfig.grid(row=0, column=5) -sparkWineSetting.grid(row=0, column=6) -getProgramIcon.grid(row=0, column=7) -winetricksOpen.grid(row=0, column=8) +#openWineBotton.grid(row=0, column=2) +#installWineFont.grid(row=0, column=3) +uninstallProgram.grid(row=0, column=2) +wineConfig.grid(row=0, column=3) +sparkWineSetting.grid(row=0, column=4) +getProgramIcon.grid(row=0, column=5) +#winetricksOpen.grid(row=0, column=8) +trasButton.grid(row=0, column=6) sendFrame.grid(row=5, column=0, columnspan=3) button5.grid(row=0, column=0) saveDesktopFileOnLauncher.grid(row=0, column=1) @@ -904,4 +1031,8 @@ o1.grid(row=2, column=1) returnText.grid(row=6, column=0, columnspan=3) # 启动窗口 window.pack(fill=tk.BOTH, expand = True) +# 窗口居中 +win.update() +win.geometry(f"{win.winfo_width()}x{win.winfo_height()}+{win.winfo_screenwidth() // 2 - win.winfo_width() // 2}+{win.winfo_screenheight() // 2 - win.winfo_height() // 2}") +# 显示窗口 win.mainloop() diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug new file mode 100755 index 0000000..54e5667 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner-update-bug @@ -0,0 +1,133 @@ +#!/usr/bin/env python3 +import os +import json +import base64 +import requests +import ttkthemes +import traceback +import webbrowser +import tkinter as tk +import tkinter.ttk as ttk +import tkinter.messagebox as messagebox +import urllib.parse as parse + +# 读取文本文档 +def readtxt(path: "路径")->"读取文本文档": + f = open(path, "r") # 设置文件对象 + str = f.read() # 获取内容 + f.close() # 关闭文本对象 + return str # 返回结果 + +def Update(name, stars, contact, things, version): + # post 内容 + data = { + "Name": name, + "Starts": stars, + "Contact": contact, + "Things": things, + "Version": version + } + try: + messagebox.showinfo(message=requests.post(parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9idWcvdXBsb2FkLnBocA==").decode("utf-8")), data=data).text) + except: + traceback.print_exc() + messagebox.showerror(title="错误", message="服务器疑似出现错误,可以进行以下尝试:①多尝试几次;②使用其他反馈途径\n错误信息:{}".format(traceback.format_exc())) + +def UpdateButtonClick(): + #判断是否为空 + if nameThings.get() == "" or starValue.get() == "" or contactThings.get() == "" or updateThings.get(1.0, "end").replace(" ", "").replace("\n", "") == "": + messagebox.showerror(title="错误", message="反馈信息未填写完整!") + return + Update(name=nameThings.get(), stars=starValue.get(), contact=contactThings.get(), things=updateThings.get(1.0, "end"), version=version) + +def OpenGiteeIssues(): + webbrowser.open_new_tab("https://gitee.com/gfdgd-xi/deep-wine-runner/issues") + +def OpenGithubIssues(): + webbrowser.open_new_tab("https://github.com/gfdgd-xi/deep-wine-runner/issues") + +def OpenGitlinkIssues(): + webbrowser.open_new_tab("https://www.gitlink.org.cn/gfdgd_xi/deep-wine-runner/issues") + +# 获取用户主目录 +def get_home()->"获取用户主目录": + return os.path.expanduser('~') + +########################### +# 程序信息 +########################### +iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0]) +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +information = json.loads(readtxt(programPath + "/information.json")) +version = information["Version"] + +########################### +# 窗口创建 +########################### +# 读取主题 +try: + theme = not ("dark" in readtxt(get_home() + "/.gtkrc-2.0") and "gtk-theme-name=" in readtxt(get_home() + "/.gtkrc-2.0")) +except: + print("主题读取错误,默认使用浅色主题") + theme = True +if theme: + window = tk.Tk() + themes = ttkthemes.ThemedStyle(window) + themes.set_theme("breeze") +else: + import ttkbootstrap + style = ttkbootstrap.Style(theme="darkly") + window = style.master # 创建窗口 +win = ttk.Frame() + +starValue = tk.StringVar() +starValue.set("5分") + +name = ttk.Label(win, text="你的昵称:") +nameThings = ttk.Entry(win, width=25) + +contact = ttk.Label(win, text="联系方式(电子邮箱):") +contactThings = ttk.Entry(win, width=25) + +star = ttk.Label(win, text="评分:") +starMenu = ttk.OptionMenu(win, starValue, "5分", "5分", "4分", "3分", "2分", "1分") + +updateThingsTips = ttk.Label(win, text="反馈内容(支持 Markdown 格式):") +updateThings = tk.Text(win, width=100) + +otherUpload = ttk.Frame(win) +# 所属内容 +tips = ttk.Label(otherUpload, text="如果无法正常反馈,可以用其他方式反馈:") +giteeButton = ttk.Button(otherUpload, text="Gitee Issues", command=OpenGiteeIssues) +githubButton = ttk.Button(otherUpload, text="Github Issues", command=OpenGithubIssues) +gitlinkButton = ttk.Button(otherUpload, text="Gitlink Issues", command=OpenGitlinkIssues) + +updateButton = ttk.Button(win, text="提交", command=UpdateButtonClick) + +# 设置窗口 +window.title("Wine 运行器 {} 问题/建议反馈".format(version)) +window.resizable(0, 0) +window.iconphoto(False, tk.PhotoImage(file=iconPath)) + +tips.grid(row=0, column=0) +giteeButton.grid(row=0, column=1) +githubButton.grid(row=0, column=2) +gitlinkButton.grid(row=0, column=3) + +name.grid(row=0, column=0) +nameThings.grid(row=0, column=1) + +contact.grid(row=0, column=2) +contactThings.grid(row=0, column=3) + +star.grid(row=0, column=4) +starMenu.grid(row=0, column=5) + +updateThingsTips.grid(row=1, column=0, columnspan=2) +updateThings.grid(row=2, column=0, columnspan=6) + +otherUpload.grid(row=3, column=0, columnspan=4, sticky=tk.W) +updateButton.grid(row=3, column=5) + +win.pack(expand="yes", fill="both") +window.mainloop() \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/information.json b/deb/opt/apps/deepin-wine-runner/information.json index 124e3d9..22d820a 100644 --- a/deb/opt/apps/deepin-wine-runner/information.json +++ b/deb/opt/apps/deepin-wine-runner/information.json @@ -1,3 +1,13 @@ { - "Version": "1.5.3" + "Version": "1.6.0", + "Thank": [ + "@a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301", + "@zhangs https://bbs.deepin.org/post/227948", + "@gtjmaster https://bbs.deepin.org/post/225509", + "@统信UCARE服务 https://mp.weixin.qq.com/s/iOdfNv6phc8F4inackFFTw", + "@星火应用商店 提供部分安装包的源以及本程序的下载地址", + "", + "可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的更新!", + "如果上面有遗漏,请向我反馈补充" + ] } \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/wine install b/deb/opt/apps/deepin-wine-runner/wine install index 0d87083..3aaa928 100755 --- a/deb/opt/apps/deepin-wine-runner/wine install +++ b/deb/opt/apps/deepin-wine-runner/wine install @@ -2,8 +2,8 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi -# 版本:1.4.1 -# 更新时间:2022年06月22日 +# 版本:1.5.3 +# 更新时间:2022年07月08日 # 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 # 基于 Python3 的 tkinter 构建 ########################################################################################### @@ -36,14 +36,14 @@ choose = input().upper() if not choose == "N": if os.path.exists("/etc/apt/sources.list.d/sparkstore.list"): os.system("sudo apt install deepin-wine5 -y") - if not os.path.exists("/etc/apt/sources.list.d/sparkstore.list"): - os.system("sudo touch /etc/apt/sources.list.d/sparkstore.list") - os.system("echo 'deb [by-hash=force] https://d.store.deepinos.org.cn/ /' | sudo tee '/etc/apt/sources.list.d/sparkstore.list'") - - os.system("sudo apt update") + os.system("sudo touch /etc/apt/sources.list.d/sparkstore.list") + os.system("echo 'deb [by-hash=force] https://d.store.deepinos.org.cn/ /' | sudo tee '/etc/apt/sources.list.d/sparkstore.list'") + os.system("mkdir -p /tmp/spark-store-install") + os.system("wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc") + os.system("cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg") + os.system("apt update -o Dir::Etc::sourcelist=\"sources.list.d/sparkstore.list\" -o Dir::Etc::sourceparts=\"-\" -o APT::Get::List-Cleanup=\"0\"") + os.system("sudo apt update") os.system("sudo apt install deepin-wine5 -y") - if os.path.exists("/etc/apt/sources.list.d/sparkstore.list"): - os.system("sudo apt update") print("请问是否要安装 deepin-wine5-stable?[Y/N]", end=' ') choose = input().upper() if not choose == "N": @@ -52,8 +52,17 @@ print("请问是否要安装 deepin-wine6-stable?[Y/N]", end=' ') choose = input().upper() if not choose == "N": os.system("sudo apt install deepin-wine6-stable -y") -print("请问是否要安装 spark-wine7-devel?[Y/N]", end=' ') +print("请问是否要安装 spark-wine7-devel?(需要添加星火应用商店的源)[Y/N]", end=' ') choose = input().upper() if not choose == "N": + if os.path.exists("/etc/apt/sources.list.d/sparkstore.list"): + os.system("sudo apt install spark-wine7-devel -y") + os.system("sudo touch /etc/apt/sources.list.d/sparkstore.list") + os.system("echo 'deb [by-hash=force] https://d.store.deepinos.org.cn/ /' | sudo tee '/etc/apt/sources.list.d/sparkstore.list'") + os.system("mkdir -p /tmp/spark-store-install") + os.system("wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc") + os.system("cp -f /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg") + os.system("apt update -o Dir::Etc::sourcelist=\"sources.list.d/sparkstore.list\" -o Dir::Etc::sourceparts=\"-\" -o APT::Get::List-Cleanup=\"0\"") + os.system("sudo apt update") os.system("sudo apt install spark-wine7-devel -y") print("全部完成!") \ No newline at end of file diff --git a/information.json b/information.json index d48f0d7..22d820a 100644 --- a/information.json +++ b/information.json @@ -5,7 +5,9 @@ "@zhangs https://bbs.deepin.org/post/227948", "@gtjmaster https://bbs.deepin.org/post/225509", "@统信UCARE服务 https://mp.weixin.qq.com/s/iOdfNv6phc8F4inackFFTw", + "@星火应用商店 提供部分安装包的源以及本程序的下载地址", "", - "可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的更新!" + "可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的更新!", + "如果上面有遗漏,请向我反馈补充" ] } \ No newline at end of file diff --git a/main.py b/main.py index a47eee7..4553d7c 100755 --- a/main.py +++ b/main.py @@ -2,8 +2,8 @@ # 使用系统默认的 python3 运行 ########################################################################################### # 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 -# 版本:1.5.3 -# 更新时间:2022年07月07日 +# 版本:1.6.0 +# 更新时间:2022年07月10日 # 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 # 基于 Python3 的 tkinter 构建 ########################################################################################### @@ -417,6 +417,15 @@ def InstallMSXML(): os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"'{programPath}/InstallMsxml.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open") DisableButton(False) +def InstallOther(): + DisableButton(True) + if e1.get() == "": + wineBottonPath = setting["DefultBotton"] + else: + wineBottonPath = e1.get() + os.system(f"'{programPath}/launch.sh' deepin-terminal -C \"'{programPath}/InstallOther.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open") + DisableButton(False) + def BuildExeDeb(): if e1.get() == "": wineBottonPath = setting["DefultBotton"] @@ -698,6 +707,7 @@ class ProgramSetting(): defultBotton = None terminalOpen = None wineOption = None + wineBottonDifferent = None def ShowWindow(): message = tk.Toplevel() ProgramSetting.wineBottonA = tk.StringVar() @@ -722,6 +732,10 @@ class ProgramSetting(): ttk.Label(message, text="自定义 wine 参数:").grid(row=5, column=0) ProgramSetting.wineOption = tk.StringVar() ProgramSetting.wineOption.set(setting["WineOption"]) + #ttk.Label(message, text="容器创建规则:").grid(row=6, column=0) + #ProgramSetting.wineBottonDifferent = tk.IntVar() + #ProgramSetting.wineBottonDifferent.set(setting["WineBottonDifferent"]) + ttk.Checkbutton(message, text="为每一个可执行文件创建单独的容器(如果勾选的话,上面默认 Wine 容器选项将会指定这些产生的 Wine 容器默认存放目录)", variable=ProgramSetting.wineBottonDifferent) ttk.Entry(message, width=40, textvariable=ProgramSetting.wineOption).grid(row=5, column=1, columnspan=2) ttk.Button(message, text="保存", command=ProgramSetting.Save).grid(row=6, column=0, columnspan=3, sticky=tk.E) # 设置 @@ -743,6 +757,7 @@ class ProgramSetting(): setting["DefultBotton"] = ProgramSetting.defultBotton.get() setting["TerminalOpen"] = bool(ProgramSetting.terminalOpen.get()) setting["WineOption"] = ProgramSetting.wineOption.get() + setting["WineBottonDifferent"] = bool(ProgramSetting.wineBottonDifferent.get()) try: write_txt(get_home() + "/.config/deepin-wine-runner/WineSetting.json", json.dumps(setting)) except: @@ -760,7 +775,8 @@ defultProgramList = { "DefultWine": "deepin-wine6 stable", "DefultBotton" : get_home() + "/.wine", "TerminalOpen": False, - "WineOption": "" + "WineOption": "", + "WineBottonDifferent": False } if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹 os.mkdir(get_home() + "/.config/deepin-wine-runner") # 创建配置文件夹 @@ -796,7 +812,7 @@ try: isoPathFound = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/ISOPathFound.json")).values()) setting = json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/WineSetting.json")) change = False - for i in ["Architecture", "Debug", "DefultWine", "DefultBotton", "TerminalOpen", "WineOption"]: + for i in ["Architecture", "Debug", "DefultWine", "DefultBotton", "TerminalOpen", "WineOption", "WineBottonDifferent"]: if not i in setting: change = True setting[i] = defultProgramList[i] @@ -831,12 +847,18 @@ tips = '''提示: exe路径\' 参数 \' 即可(单引号需要输入) 5、wine 容器如果没有指定,则会默认为 ~/.wine''' -updateThingsString = '''※1、新增专门的程序设置,支持设置 Wine 容器架构、DEBUG 信息是否输出、默认的 Wine、默认容器路径、是否使用终端打开和 Wine 参数 -※2、修复了 wine 打包器的控件禁用不全和打包的 deb 用户残留的问题 -※3、新增暗黑主题 -4、合并了 deepin wine 文管设置器''' +updateThingsString = '''※1、新增程序感谢、谢明以及程序的建议和问题反馈和内置更新程序 +※2、支持 winetricks 指定 Wine 打开 +※3、新增窗口透明工具,感谢@a2035274 和 @虚幻的早晨 在论坛的讨论 +※4、支持在指定容器、Wine 安装 MSXML +※5、支持启用/关闭 opengl(感谢@zhangs 在论坛发帖)以及支持安装/卸载 winbind +※6、添加云沙箱的网站链接快捷方式 +※7、支持从星火应用商店源安装 Windows 常见字体 +8、优化窗口布局以及默认显示位置 +9、支持打开指定容器、Wine 的资源管理器 +''' title = "wine 运行器 {}".format(version) -updateTime = "2022年07月07日" +updateTime = "2022年07月10日" updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y")) thankText = "" for i in information["Thank"]: @@ -917,6 +939,7 @@ wineOption.add_command(label="在指定wine、指定容器安装 Visual Studio C wineOption.add_command(label="在指定wine、指定容器安装 MSXML", command=lambda: threading.Thread(target=InstallMSXML).start()) wineOption.add_command(label="在指定wine、指定容器安装 gecko", command=lambda: threading.Thread(target=InstallMonoGecko, args=["gecko"]).start()) wineOption.add_command(label="在指定wine、指定容器安装 mono", command=lambda: threading.Thread(target=InstallMonoGecko, args=["mono"]).start()) +wineOption.add_command(label="在指定wine、指定容器安装其它运行库", command=lambda: threading.Thread(target=InstallOther).start()) wineOption.add_separator() wineOption.add_command(label="打开指定wine、指定容器的控制面板", command=lambda: threading.Thread(target=RunWineProgram, args=["control"]).start()) wineOption.add_command(label="打开指定wine、指定容器的浏览器", command=lambda: threading.Thread(target=RunWineProgram, args=["iexplore' 'https://www.deepin.org"]).start()) @@ -929,7 +952,7 @@ wineOption.add_command(label="设置 run_v3.sh 的文管为 Deepin 默认文管" wineOption.add_command(label="设置 run_v3.sh 的文管为 Wine 默认文管", command=SetDeepinFileDialogDefult) wineOption.add_command(label="重新安装 deepin-wine-helper", command=SetDeepinFileDialogRecovery) wineOption.add_separator() -wineOption.add_command(label="使用winetricks打开指定容器(只能使用wine和wine64)", command=lambda: threading.Thread(target=RunWinetricks).start()) +wineOption.add_command(label="使用winetricks打开指定容器", command=lambda: threading.Thread(target=RunWinetricks).start()) wineOption.add_separator() opengl = tk.Menu() opengl.add_command(label="开启 opengl", command=lambda: threading.Thread(target=RunWineProgram, args=[f"regedit.exe' /s '{programPath}/EnabledOpengl.reg"]).start()) @@ -1008,4 +1031,8 @@ o1.grid(row=2, column=1) returnText.grid(row=6, column=0, columnspan=3) # 启动窗口 window.pack(fill=tk.BOTH, expand = True) +# 窗口居中 +win.update() +win.geometry(f"{win.winfo_width()}x{win.winfo_height()}+{win.winfo_screenwidth() // 2 - win.winfo_width() // 2}+{win.winfo_screenheight() // 2 - win.winfo_height() // 2}") +# 显示窗口 win.mainloop()