mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 11:02:04 +08:00
1.5.1
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
# 使用系统默认的 python3 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi
|
||||
# 版本:1.5.0
|
||||
# 版本:1.5.1
|
||||
# 更新时间:2022年07月03日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 tkinter 构建
|
||||
@@ -31,9 +31,6 @@ def InstallSparkWine(wine):
|
||||
###################
|
||||
# 程序功能
|
||||
###################
|
||||
#print("请按回车:")
|
||||
#input()
|
||||
#os.system("clear")
|
||||
print("请保证你能有 root 权限以便安装")
|
||||
print("如果有请按回车,否则按 [Ctrl+C] 退出", end=' ')
|
||||
input()
|
||||
@@ -70,4 +67,8 @@ if not choose == "N":
|
||||
if not os.path.exists("/etc/apt/sources.list.d/sparkstore.list"):
|
||||
AddSparkStoreSource()
|
||||
InstallSparkWine("spark-wine7-devel")
|
||||
print("请问是否要安装 ukylin-wine(需要添加 ukylin 源,但因为可能会导致系统问题,将不会自动添加)?[Y/N]", end=" ")
|
||||
choose = input().upper()
|
||||
if not choose == "N":
|
||||
os.system("sudo apt install ukylin-wine -y")
|
||||
print("全部完成!")
|
||||
BIN
deb/opt/apps/deepin-wine-runner/BeCyIconGrabber.exe
Executable file
BIN
deb/opt/apps/deepin-wine-runner/BeCyIconGrabber.exe
Executable file
Binary file not shown.
51
deb/opt/apps/deepin-wine-runner/InstallMono.py
Executable file
51
deb/opt/apps/deepin-wine-runner/InstallMono.py
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/usr/bin/env python3
|
||||
# 使用系统默认的 python3 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:1.5.1
|
||||
# 更新时间:2022年07月04日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 tkinter 构建
|
||||
###########################################################################################
|
||||
#################
|
||||
# 引入所需的库
|
||||
#################
|
||||
import os
|
||||
import sys
|
||||
import pyquery
|
||||
|
||||
if "--help" in sys.argv:
|
||||
print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢")
|
||||
print("版本:1.0.0")
|
||||
print("本程序可以更方便的在 wine 容器中安装 mono、gecko")
|
||||
sys.exit()
|
||||
if len(sys.argv) <= 3 or sys.argv[1] == "" or sys.argv[2] == "" or sys.argv[3] == "":
|
||||
print("您未指定需要安装 gecko 或者 mono 的容器和使用的 wine,无法继续")
|
||||
print("参数:")
|
||||
print("XXX 参数一 参数二 参数三")
|
||||
print("参数一为需要安装的容器,参数二为需要使用的wine,参数三为安装gecko或mono(gecko/mono),三个参数位置不能颠倒")
|
||||
sys.exit()
|
||||
# 获取最新版本的版本号
|
||||
programVersionList = pyquery.PyQuery(url=f"http://mirrors.ustc.edu.cn/wine/wine/wine-{sys.argv[3]}/")
|
||||
programVersion = programVersionList("a:last-child").attr.href
|
||||
# 获取最新版本安装包的URL
|
||||
programUrl = pyquery.PyQuery(url=f"http://mirrors.ustc.edu.cn/wine/wine/wine-{sys.argv[3]}/{programVersion}")
|
||||
programDownloadUrl = ""
|
||||
programFileName = ""
|
||||
for i in programUrl("a").items():
|
||||
if i.attr.href[-4:] == ".msi":
|
||||
programDownloadUrl = f"http://mirrors.ustc.edu.cn/wine/wine/wine-{sys.argv[3]}/{programVersion}{i.attr.href}"
|
||||
programFileName = i.attr.href
|
||||
break
|
||||
|
||||
if programDownloadUrl == "":
|
||||
print("无法获取链接,无法继续")
|
||||
sys.exit()
|
||||
print(f"当前选择的程序获取路径:{programDownloadUrl}")
|
||||
print("开始下载")
|
||||
os.system("rm -rf /tmp/winegeckomonoinstall")
|
||||
os.system("mkdir -p /tmp/winegeckomonoinstall")
|
||||
os.system(f"aria2c -x 16 -s 16 -d /tmp/winegeckomonoinstall -o install.msi \"{programDownloadUrl}\"")
|
||||
print("开始安装")
|
||||
os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i /tmp/winegeckomonoinstall/install.msi")
|
||||
print("安装结束")
|
||||
58
deb/opt/apps/deepin-wine-runner/InstallNetFramework.py
Executable file
58
deb/opt/apps/deepin-wine-runner/InstallNetFramework.py
Executable file
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env python3
|
||||
# 使用系统默认的 python3 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:1.5.1
|
||||
# 更新时间:2022年07月04日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 tkinter 构建
|
||||
###########################################################################################
|
||||
#################
|
||||
# 引入所需的库
|
||||
#################
|
||||
import os
|
||||
import sys
|
||||
|
||||
if "--help" in sys.argv:
|
||||
print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢")
|
||||
print("版本:1.0.0")
|
||||
print("本程序可以更方便的在 wine 容器中安装 .net framework")
|
||||
sys.exit()
|
||||
if len(sys.argv) <= 2 or sys.argv[1] == "" or sys.argv[2] == "":
|
||||
print("您未指定需要安装 .net framework 的容器和使用的 wine,无法继续")
|
||||
print("参数:")
|
||||
print("XXX 参数一 参数二")
|
||||
print("参数一为需要安装的容器,参数二为需要使用的wine,两个参数位置不能颠倒")
|
||||
sys.exit()
|
||||
netList = [
|
||||
["3.5 SP1 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/b635098a-2d1d-4142-bef6-d237545123cb/2651b87007440a15209cac29634a4e45/dotnetfx35.exe"],
|
||||
["4.0 Offline Installer", "https://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe"],
|
||||
["4.5 Web Installer", "https://download.microsoft.com/download/B/A/4/BA4A7E71-2906-4B2D-A0E1-80CF16844F5F/dotNetFx45_Full_setup.exe"],
|
||||
["4.5.1 Offline Installer", "https://download.microsoft.com/download/1/6/7/167F0D79-9317-48AE-AEDB-17120579F8E2/NDP451-KB2858728-x86-x64-AllOS-ENU.exe"],
|
||||
["4.5.2 Offline Installer", "https://download.microsoft.com/download/E/2/1/E21644B5-2DF2-47C2-91BD-63C560427900/NDP452-KB2901907-x86-x64-AllOS-ENU.exe"],
|
||||
["4.6 Offline Installer", "https://download.microsoft.com/download/6/F/9/6F9673B1-87D1-46C4-BF04-95F24C3EB9DA/enu_netfx/NDP46-KB3045557-x86-x64-AllOS-ENU_exe/NDP46-KB3045557-x86-x64-AllOS-ENU.exe"],
|
||||
["4.6.1 Offline Installer", "https://download.microsoft.com/download/E/4/1/E4173890-A24A-4936-9FC9-AF930FE3FA40/NDP461-KB3102436-x86-x64-AllOS-ENU.exe"],
|
||||
["4.6.2 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/8e396c75-4d0d-41d3-aea8-848babc2736a/80b431456d8866ebe053eb8b81a168b3/ndp462-kb3151800-x86-x64-allos-enu.exe"],
|
||||
["4.7 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/2dfcc711-bb60-421a-a17b-76c63f8d1907/e5c0231bd5d51fffe65f8ed7516de46a/ndp47-kb3186497-x86-x64-allos-enu.exe"],
|
||||
["4.7.1 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/4312fa21-59b0-4451-9482-a1376f7f3ba4/9947fce13c11105b48cba170494e787f/ndp471-kb4033342-x86-x64-allos-enu.exe"],
|
||||
["4.7.2 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/1f5af042-d0e4-4002-9c59-9ba66bcf15f6/089f837de42708daacaae7c04b7494db/ndp472-kb4054530-x86-x64-allos-enu.exe"],
|
||||
["4.8 Offline Installer", "https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe"]
|
||||
]
|
||||
print("请选择以下的 .net framework 进行安装(不保证能正常安装运行)")
|
||||
for i in range(0, len(netList)):
|
||||
print(f"{i} .net framework {netList[i][0]}")
|
||||
while True:
|
||||
try:
|
||||
choose = int(input("请输入要选择的 .net framework 版本:"))
|
||||
except:
|
||||
print("输入错误,请重新输入")
|
||||
continue
|
||||
if 0 <= choose and choose < len(netList):
|
||||
break
|
||||
print(f"您选择了 .net framework {netList[choose][0]}")
|
||||
print("开始下载")
|
||||
os.system("rm -rf /tmp/wineinstallnetframework")
|
||||
os.system("mkdir -p /tmp/wineinstallnetframework")
|
||||
os.system(f"aria2c -x 16 -s 16 -d /tmp/wineinstallnetframework -o install.exe \"{netList[choose][1]}\"")
|
||||
os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineinstallnetframework/install.exe")
|
||||
print("安装结束")
|
||||
19
deb/opt/apps/deepin-wine-runner/Run.bat
Normal file
19
deb/opt/apps/deepin-wine-runner/Run.bat
Normal file
@@ -0,0 +1,19 @@
|
||||
::###########################################################################################
|
||||
::# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
::# 版本:1.5.1
|
||||
::# 更新时间:2022年07月04日
|
||||
::# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
::# 基于 Python3 的 tkinter 构建
|
||||
::###########################################################################################
|
||||
|
||||
@echo off
|
||||
:: 遍历盘符判断文件是否存在,如果存在则运行指定程序
|
||||
for %%i in (Z, Y, X, W, V, U, T, S, R, Q, P, O, N, M, L, K, J, I, H, G, F, E, D, C, B, A) do (
|
||||
if exist %%i":"%1 (
|
||||
start %%i:%1 %%i:%2
|
||||
echo %%i:%1 %2
|
||||
exit
|
||||
)
|
||||
else (
|
||||
echo Unable To Find File
|
||||
))
|
||||
@@ -1,8 +1,8 @@
|
||||
#!/usr/bin/env python3
|
||||
# 使用系统默认的 python3 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi
|
||||
# 版本:1.5.0
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:1.5.1
|
||||
# 更新时间:2022年07月03日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 的 tkinter 构建
|
||||
@@ -92,21 +92,27 @@ def DisableButton(things):
|
||||
button1.configure(state=a[things])
|
||||
button2.configure(state=a[things])
|
||||
button3.configure(state=a[things])
|
||||
wineConfig.configure(state=a[things])
|
||||
e1.configure(state=a[things])
|
||||
e2.configure(state=a[things])
|
||||
o1.configure(state=a[things])
|
||||
winetricksOpen.configure(state=a[things])
|
||||
getProgramIcon.configure(state=a[things])
|
||||
uninstallProgram.configure(state=a[things])
|
||||
|
||||
# 运行可执行文件的线程
|
||||
def runexebutton_threading():
|
||||
DisableButton(True)
|
||||
if e1.get() == "" or e2.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 wine 容器或需要运行的 exe 应用")
|
||||
if e2.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 exe 应用")
|
||||
DisableButton(False)
|
||||
return
|
||||
else: # 如果都有
|
||||
#text = subprocess.getoutput("WINEPREFIX='" + e1.get() + "' " + wine[o1_text.get()] + " '" + e2.get() + "'") # 运行
|
||||
res = subprocess.Popen(["WINEPREFIX='" + e1.get() + "' " + wine[o1_text.get()] + " '" + e2.get() + "'"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + wine[o1_text.get()] + " '" + e2.get() + "'"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 清空文本框内容
|
||||
returnText.config(state=tk.NORMAL)
|
||||
returnText.delete(1.0, "end")
|
||||
@@ -114,11 +120,14 @@ def runexebutton_threading():
|
||||
# 实时读取程序返回
|
||||
while res.poll() is None:
|
||||
returnText.config(state=tk.NORMAL)
|
||||
text = res.stdout.readline().decode("utf8")
|
||||
try:
|
||||
text = res.stdout.readline().decode("utf8")
|
||||
except:
|
||||
text = ""
|
||||
returnText.insert("end", text)
|
||||
print(text)
|
||||
returnText.config(state=tk.DISABLED)
|
||||
findExeHistory.append(e1.get()) # 将记录写进数组
|
||||
findExeHistory.append(wineBottonPath) # 将记录写进数组
|
||||
wineBottonHistory.append(e2.get()) # 将记录写进数组
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json", str(json.dumps(ListToDictionary(findExeHistory)))) # 将历史记录的数组转换为字典并写入
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json", str(json.dumps(ListToDictionary(wineBottonHistory)))) # 将历史记录的数组转换为字典并写入
|
||||
@@ -157,8 +166,8 @@ def UpdateThings():
|
||||
|
||||
# 生成 desktop 文件在启动器
|
||||
def make_desktop_on_launcher():
|
||||
if combobox1.get() == "" or e2.get() == "" or e1.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 wine 容器或需要运行的 exe 应用或保存的文件名")
|
||||
if combobox1.get() == "" or e2.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用 exe 应用或保存的文件名")
|
||||
else: # 如果都有
|
||||
if os.path.exists(get_home() + "/.local/share/applications/" + combobox1.get() + ".desktop"): # 判断目录是否有该文件,如果有
|
||||
choose = tkinter.messagebox.askokcancel(title="提示", message="文件已经存在,是否覆盖?") # 询问用户是否覆盖
|
||||
@@ -166,10 +175,13 @@ def make_desktop_on_launcher():
|
||||
os.remove(get_home() + "/.local/share/applications/" + combobox1.get() + ".desktop") # 删除该文件
|
||||
else: # 如不覆盖
|
||||
return # 结束
|
||||
#os.mknod(get_home() + "/.local/share/applications/" + combobox1.get() + ".desktop")
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
write_txt(get_home() + "/.local/share/applications/" + combobox1.get() + ".desktop", f'''[Desktop Entry]
|
||||
Name={combobox1.get()}
|
||||
Exec=env WINEPREFIX='{e1.get()}' {wine[o1_text.get()]} '{e2.get()}'
|
||||
Exec=env WINEPREFIX='{wineBottonPath}' {wine[o1_text.get()]} '{e2.get()}'
|
||||
Icon={iconPath}
|
||||
Type=Application
|
||||
StartupNotify=true''') # 写入文本文档
|
||||
@@ -181,8 +193,8 @@ StartupNotify=true''') # 写入文本文档
|
||||
# 生成 desktop 文件在桌面
|
||||
# (第四个按钮的事件)
|
||||
def make_desktop_on_desktop():
|
||||
if combobox1.get() == "" or e2.get() == "" or e1.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 wine 容器或需要运行的 exe 应用或保存的文件名")
|
||||
if combobox1.get() == "" or e2.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 exe 应用或保存的文件名")
|
||||
else: # 如果都有
|
||||
if os.path.exists(get_desktop_path() + "/" + combobox1.get() + ".desktop"): # 判断目录是否有该文件,如果有
|
||||
choose = tkinter.messagebox.askokcancel(title="提示", message="文件已经存在,是否覆盖?") # 询问用户是否覆盖
|
||||
@@ -190,10 +202,14 @@ def make_desktop_on_desktop():
|
||||
os.remove(get_desktop_path() + "/" + combobox1.get() + ".desktop") # 删除该文件
|
||||
else: # 如不覆盖
|
||||
return # 结束
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
os.mknod(get_desktop_path() + "/" + combobox1.get() + ".desktop")
|
||||
write_txt(get_desktop_path() + "/" + combobox1.get() + ".desktop", f'''[Desktop Entry]
|
||||
Name={combobox1.get()}
|
||||
Exec=env WINEPREFIX='{e1.get()}' {wine[o1_text.get()]} '{e2.get()}'
|
||||
Exec=env WINEPREFIX='{wineBottonPath}' {wine[o1_text.get()]} '{e2.get()}'
|
||||
Icon={iconPath}
|
||||
Type=Application
|
||||
StartupNotify=true''') # 写入文本文档
|
||||
@@ -228,41 +244,99 @@ def InstallWine():
|
||||
|
||||
def OpenWineBotton():
|
||||
if e1.get() == "":
|
||||
tkinter.messagebox.showinfo(title="提示", message="您未选择需要打开的 Wine 容器")
|
||||
return
|
||||
os.system("xdg-open \"" + e1.get().replace("\"", "\\\"") + "\"")
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
os.system("xdg-open \"" + wineBottonPath.replace("\'", "\\\'") + "\"")
|
||||
|
||||
def OpenWineFontPath():
|
||||
if e1.get() == "":
|
||||
tkinter.messagebox.showinfo(title="提示", message="您未选择需要打开的 Wine 容器")
|
||||
return
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
tkinter.messagebox.showinfo(title="提示", message="如果安装字体?只需要把字体文件复制到此字体目录\n按下“OK”按钮可以打开字体目录")
|
||||
os.system("xdg-open \"" + e1.get().replace("\"", "\\\"") + "/drive_c/windows/Fonts\"")
|
||||
os.system("xdg-open \"" + wineBottonPath.replace("\'", "\\\'") + "/drive_c/windows/Fonts\"")
|
||||
|
||||
def UninstallProgram():
|
||||
threading.Thread(target=UninstallProgram_threading).start()
|
||||
|
||||
def UninstallProgram_threading():
|
||||
threading.Thread(target=RunWineProgram, args=[programPath + "/geek.exe"]).start()
|
||||
|
||||
def ConfigWineBotton():
|
||||
threading.Thread(target=RunWineProgram, args=["winecfg"]).start()
|
||||
|
||||
def RunWineProgram(wineProgram, history = False):
|
||||
DisableButton(True)
|
||||
if e1.get() == "": # 判断文本框是否有内容
|
||||
tkinter.messagebox.showinfo(title="提示", message="没有填写需要使用的 wine 容器")
|
||||
DisableButton(False)
|
||||
else: # 如果都有
|
||||
#text = subprocess.getoutput("WINEPREFIX='" + e1.get() + "' " + wine[o1_text.get()] + " '" + e2.get() + "'") # 运行
|
||||
res = subprocess.Popen(["WINEPREFIX='" + e1.get() + "' " + wine[o1_text.get()] + " '" + programPath + "/geek.exe'"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 清空文本框内容
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
print("WINEPREFIX='" + wineBottonPath + "' " + wine[o1_text.get()] + " '" + wineProgram + "'")
|
||||
res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + wine[o1_text.get()] + " '" + wineProgram + "'"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 清空文本框内容
|
||||
returnText.config(state=tk.NORMAL)
|
||||
returnText.delete(1.0, "end")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
# 实时读取程序返回
|
||||
while res.poll() is None:
|
||||
returnText.config(state=tk.NORMAL)
|
||||
returnText.delete(1.0, "end")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
# 实时读取程序返回
|
||||
while res.poll() is None:
|
||||
returnText.config(state=tk.NORMAL)
|
||||
try:
|
||||
text = res.stdout.readline().decode("utf8")
|
||||
returnText.insert("end", text)
|
||||
print(text)
|
||||
returnText.config(state=tk.DISABLED)
|
||||
except:
|
||||
text = ""
|
||||
returnText.insert("end", text)
|
||||
print(text)
|
||||
returnText.config(state=tk.DISABLED)
|
||||
if history:
|
||||
findExeHistory.append(wineBottonPath) # 将记录写进数组
|
||||
wineBottonHistory.append(e2.get()) # 将记录写进数组
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json", str(json.dumps(ListToDictionary(findExeHistory)))) # 将历史记录的数组转换为字典并写入
|
||||
write_txt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json", str(json.dumps(ListToDictionary(wineBottonHistory)))) # 将历史记录的数组转换为字典并写入
|
||||
e1['value'] = findExeHistory
|
||||
e2['value'] = wineBottonHistory
|
||||
DisableButton(False)
|
||||
|
||||
def RunWinetricks():
|
||||
DisableButton(True)
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
if not e1.get() == "":
|
||||
wineBottonPath = e1.get()
|
||||
print("WINEPREFIX='" + wineBottonPath + "' winetricks")
|
||||
res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' winetricks"], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
||||
# 清空文本框内容
|
||||
returnText.config(state=tk.NORMAL)
|
||||
returnText.delete(1.0, "end")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
# 实时读取程序返回
|
||||
while res.poll() is None:
|
||||
returnText.config(state=tk.NORMAL)
|
||||
try:
|
||||
text = res.stdout.readline().decode("utf8")
|
||||
except:
|
||||
text = ""
|
||||
returnText.insert("end", text)
|
||||
print(text)
|
||||
returnText.config(state=tk.DISABLED)
|
||||
DisableButton(False)
|
||||
|
||||
def InstallMonoGecko(program):
|
||||
DisableButton(True)
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
os.system(f"deepin-terminal -C \"'{programPath}/InstallMono.py' '{wineBottonPath}' {wine[o1_text.get()]} {program}\" --keep-open")
|
||||
DisableButton(False)
|
||||
|
||||
def InstallNetFramework():
|
||||
DisableButton(True)
|
||||
if e1.get() == "":
|
||||
wineBottonPath = get_home() + "/.wine"
|
||||
else:
|
||||
wineBottonPath = e1.get()
|
||||
os.system(f"deepin-terminal -C \"'{programPath}/InstallNetFramework.py' '{wineBottonPath}' {wine[o1_text.get()]}\" --keep-open")
|
||||
DisableButton(False)
|
||||
|
||||
###########################
|
||||
# 加载配置
|
||||
@@ -284,7 +358,7 @@ if not os.path.exists(get_home() + "/.config/deepin-wine-runner/WineBotton.json"
|
||||
# 设置变量
|
||||
###########################
|
||||
# 如果要添加其他 wine,请在字典添加其名称和执行路径
|
||||
wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel"}
|
||||
wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine"}
|
||||
shellHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json")).values())
|
||||
findExeHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json")).values())
|
||||
wineBottonHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json")).values())
|
||||
@@ -294,8 +368,8 @@ wineBottonHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-r
|
||||
# 程序信息
|
||||
###########################
|
||||
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
|
||||
programUrl = "https://gitee.com/gfdgd-xi/deep-wine-runner"
|
||||
version = "1.5.0"
|
||||
programUrl = "https://gitee.com/gfdgd-xi/deep-wine-runner\nhttps://github.com/gfdgd-xi/deep-wine-runner\nhttps://www.gitlink.org.cn/gfdgd_xi/deep-wine-runner"
|
||||
version = "1.5.1"
|
||||
goodRunSystem = "Linux"
|
||||
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
|
||||
about = '''一个基于 Python3 的 tkinter 制作的 wine 运行器
|
||||
@@ -303,21 +377,27 @@ about = '''一个基于 Python3 的 tkinter 制作的 wine 运行器
|
||||
适用平台:{}
|
||||
tkinter 版本:{}
|
||||
程序官网:{}
|
||||
©2020-{} gfdgd xi'''.format(version, goodRunSystem, tk.TkVersion, programUrl, time.strftime("%Y"))
|
||||
©2020-{} gfdgd xi、为什么您不喜欢熊出没和阿布呢'''.format(version, goodRunSystem, tk.TkVersion, programUrl, time.strftime("%Y"))
|
||||
tips = '''提示:
|
||||
1、使用终端运行该程序,可以看到 wine 以及程序本身的提示和报错;
|
||||
2、wine 32 位和 64 位的容器互不兼容;
|
||||
3、部分 wine 系统没有预装,本程序没有设置任何 wine 的依赖项,如果需要使用请自行安装'''
|
||||
updateThingsString = '''*1、支持显示 wine 程序运行时的返回内容
|
||||
*2、优化打包方式,减少从 pip 安装的库,并将 pip 源设为阿里源提升下载速度
|
||||
*3、新增 spark-wine7-devel
|
||||
*4、支持从程序启动用于安装 wine 的程序(在菜单栏的“程序”)
|
||||
5、优化 wine 安装脚本,在安装星火应用商店的 wine 时支持检测是否有 ss-apt-fast,如果有就调用替代 apt 提升安装速度
|
||||
6、支持关闭指定 wine 的进程,以及访问对应 wine 容器的目录和字体目录
|
||||
7、从生成shell脚本改为升级到desktop文件
|
||||
3、所有的 wine 和 winetricks 均需要自行安装(可以从 菜单栏=>程序 里面进行安装)
|
||||
4、本程序支持带参数运行 wine 程序(之前版本也可以),只需要按以下格式即可:
|
||||
exe路径\' 参数 \'
|
||||
即可(单引号需要输入)
|
||||
5、wine 容器如果没有指定,则会默认为 ~/.wine'''
|
||||
updateThingsString = '''※1、支持打开 spark-wine7-devel 的专门缩放设置(如未安装则此按钮禁用)
|
||||
※2、支持提取选择的 exe 文件的图标
|
||||
※3、支持向指定的 wine 容器安装 mono、gecko、.net framework(此功能在菜单栏“Wine”中,卸载只需要使用程序的卸载按钮打开 Geek Uninstaller 即可)
|
||||
※4、支持指定特定的 wine 容器调用 winetricks
|
||||
※5、在没有指定 wine 容器的情况下,将自动设置为 ~/.wine
|
||||
6、新增 ukylin-wine
|
||||
7、将默认选择的 wine 改为 deepin-wine6 stable
|
||||
8、支持打开指定容器的 winecfg、winver、regedit、taskmgr
|
||||
9、双击使用 wine 运行器打开 exe(不知道能不能生效)
|
||||
'''
|
||||
title = "wine 运行器 {}".format(version)
|
||||
updateTime = "2022年07月03日"
|
||||
updateTime = "2022年07月04日"
|
||||
updateThings = "{} 更新内容:\n{}\n更新时间:{}".format(version, updateThingsString, updateTime, time.strftime("%Y"))
|
||||
|
||||
|
||||
@@ -330,7 +410,7 @@ window = ttk.Frame()
|
||||
# 设置变量以修改和获取值项
|
||||
o1_text = tk.StringVar()
|
||||
combobox1 = tk.StringVar()
|
||||
o1_text.set("deepin-wine")
|
||||
o1_text.set("deepin-wine6 stable")
|
||||
# 创建控件
|
||||
controlFrame = ttk.Frame(window)
|
||||
sendFrame = ttk.Frame(window)
|
||||
@@ -338,9 +418,13 @@ 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)
|
||||
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())
|
||||
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 容器:") # 创建标签控件
|
||||
@@ -350,7 +434,7 @@ label4 = ttk.Label(window, text="设置标题,以便把上方填写的信息
|
||||
e1 = ttk.Combobox(window, width=100) # 创建文本框控件
|
||||
e2 = ttk.Combobox(window, width=100) # 创建文本框控件
|
||||
combobox1 = ttk.Combobox(window, width=100)
|
||||
o1 = ttk.OptionMenu(window, o1_text, "deepin-wine", *list(wine)) # 创建选择框控件
|
||||
o1 = ttk.OptionMenu(window, o1_text, "deepin-wine6 stable", *list(wine)) # 创建选择框控件
|
||||
returnText = tk.Text(window)
|
||||
menu = tk.Menu(window, background="white") # 设置菜单栏
|
||||
programmenu = tk.Menu(menu, tearoff=0, background="white") # 设置“程序”菜单栏
|
||||
@@ -360,6 +444,14 @@ programmenu.add_separator() # 设置分界线
|
||||
programmenu.add_command(label="清空软件历史记录", command=CleanProgramHistory)
|
||||
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、指定容器安装 .net framework", command=lambda: threading.Thread(target=InstallNetFramework).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=RunWineProgram, args=["regedit"]).start())
|
||||
wineOption.add_command(label="打开指定wine、指定容器的任务管理器", command=lambda: threading.Thread(target=RunWineProgram, args=["taskmgr"]).start())
|
||||
wineOption.add_command(label="打开指定wine、指定容器的关于 wine", command=lambda: threading.Thread(target=RunWineProgram, args=["winver"]).start())
|
||||
help = tk.Menu(menu, tearoff=0, background="white") # 设置“帮助”菜单栏
|
||||
menu.add_cascade(label="帮助", menu=help)
|
||||
help.add_command(label="程序官网", command=OpenProgramURL) # 设置“程序官网”项
|
||||
@@ -373,14 +465,20 @@ themes = ttkthemes.ThemedStyle(win)
|
||||
themes.set_theme("adapta")
|
||||
win.config(bg="white")
|
||||
# 设置控件
|
||||
if len(sys.argv) > 1 and sys.argv[1]:
|
||||
e1.set(f"{get_home()}/.wine")
|
||||
e2.set(sys.argv[1])
|
||||
menu.configure(activebackground="white")
|
||||
programmenu.configure(activebackground="white")
|
||||
wineOption.configure(activebackground="white")
|
||||
help.configure(activebackground="white")
|
||||
e1['value'] = findExeHistory
|
||||
e2['value'] = wineBottonHistory
|
||||
combobox1['value'] = shellHistory
|
||||
returnText.insert("end", "此可以查看到 Wine 应用安装时的程序返回值")
|
||||
returnText.config(state=tk.DISABLED)
|
||||
if not os.path.exists("/opt/durapps/spark-dwine-helper/spark-dwine-helper-settings/settings.sh"):
|
||||
sparkWineSetting.config(state=tk.DISABLED)
|
||||
# 添加控件
|
||||
win.config(menu=menu) # 显示菜单栏
|
||||
label1.grid(row=0, column=0)
|
||||
@@ -399,6 +497,10 @@ 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)
|
||||
sendFrame.grid(row=5, column=0, columnspan=3)
|
||||
button5.grid(row=0, column=0)
|
||||
saveDesktopFileOnLauncher.grid(row=0, column=1)
|
||||
|
||||
BIN
deb/opt/apps/deepin-wine-runner/spark-deepin-wine-runner.png
Executable file
BIN
deb/opt/apps/deepin-wine-runner/spark-deepin-wine-runner.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
Reference in New Issue
Block a user