1.7.1内容初步完成

This commit is contained in:
2022-07-27 22:40:05 +08:00
parent adcd46997b
commit 28257e2af1
52 changed files with 2316 additions and 2585 deletions

View File

@@ -1,5 +1,5 @@
Package: spark-deepin-wine-runner
Version: 1.7.0
Version: 1.7.1
Maintainer: gfdgd xi <3025613752@qq.com>, 为什么您不喜欢熊出没和阿布呢
Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner
Architecture: all

View File

@@ -1,3 +1,3 @@
# !/bin/sh
# 向服务器返回安装数加1不显示内容且忽略错误
curl http://120.25.153.144/spark-deepin-wine-runner/Install.php?Version=1.7.0 -s > /dev/null | true
curl http://120.25.153.144/spark-deepin-wine-runner/Install.php?Version=1.7.1 -s > /dev/null | true

View File

@@ -50,6 +50,9 @@ while True:
if 0 <= choose and choose < len(netList):
break
print(f"您选择了 .net framework {netList[choose][0]}")
print(f"如果是 Offline Installer 版本,提示需要连接互联网,其实是不需要的,断网也可以安装")
print(f"如果 Offline Installer 版本连接网络时安装失败,提示无法连接服务器或连接超时,可以尝试下载完安装包加载过程中断网以便断网安装")
print(f"一般建议 Offline Installer 版本在下载完 exe 安装程序后在加载过程中断网以便提高安装速度")
print("开始下载")
os.system("rm -rf /tmp/wineinstallnetframework")
os.system("mkdir -p /tmp/wineinstallnetframework")

0
deb/opt/apps/deepin-wine-runner/InstallOther.py Normal file → Executable file
View File

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python3
#########################################################################
# 作者gfdgd xi、为什么您不喜欢熊出没和阿布
# 版本1.7.0
# 版本1.8.0
# 感谢:感谢 deepin-wine 团队,提供了 deepin-wine 给大家使用,让我能做这个程序
# 基于 Python3 的 tkinter 构建
#########################################################################
@@ -150,12 +150,12 @@ class make_deb_threading(QtCore.QThread):
if not os.path.exists(e9_text.text()):
QtWidgets.QMessageBox.critical(widget, "错误", "图标的路径填写错误,无法进行构建 deb 包")
disabled_or_NORMAL_all(True)
label13_text_change("图标的路径填写错误,无法进行构建 deb 包")
self.label.emit("图标的路径填写错误,无法进行构建 deb 包")
return
if not os.path.exists(e6_text.text()):
QtWidgets.QMessageBox.critical(widget, "错误", "路径填写错误,无法继续构建 deb 包")
disabled_or_NORMAL_all(True)
label13_text_change("图标的路径填写错误,无法进行构建 deb 包")
self.label.emit("图标的路径填写错误,无法进行构建 deb 包")
return
#############
# 删除文件
@@ -452,7 +452,7 @@ def get_home():
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"}
os.chdir("/")
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
iconPath = "{}/icon.png".format(programPath)
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
information = json.loads(readtxt(f"{programPath}/information.json"))
version = information["Version"]
tips = """提示:
@@ -495,7 +495,7 @@ button4 = QtWidgets.QPushButton("浏览……")
button5 = QtWidgets.QPushButton("打包……")
rmBash = QtWidgets.QCheckBox("设置卸载该 deb 后自动删除该容器")
textbox1 = QtWidgets.QTextBrowser()
option1_text.addItems(["Network", "Chat", "Audio", "Video", "Graphics", "Office", "Translation", "Development", "Utility", "System"])
option1_text.addItems(["Network", "Chat", "Audio", "Video", "Graphics", "Office", "Translation", "Development", "Utility"])
option1_text.setCurrentText("Network")
wineFrame = QtWidgets.QHBoxLayout()
chooseWineHelperValue = QtWidgets.QCheckBox("使用星火wine helper如不勾选默认为deepin-wine-helper")

View File

@@ -3,7 +3,7 @@
###########################################################################################
# 作者gfdgd xi、为什么您不喜欢熊出没和阿布呢
# 版本1.7.0
# 更新时间2022年07月16
# 更新时间2022年07月19
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
# 基于 Python3 的 tkinter 构建
###########################################################################################
@@ -23,8 +23,6 @@ import subprocess
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
import PIL.Image as Image
import PIL.ImageTk as ImageTk
###################
# 程序所需事件
@@ -170,10 +168,11 @@ def about_this_program()->"显示“关于这个程序”窗口":
global title
global iconPath
QT.message = QtWidgets.QMainWindow()
QT.message.setWindowIcon(QtGui.QIcon(iconPath))
messageWidget = QtWidgets.QWidget()
QT.message.setWindowTitle(f"关于 {title}")
messageLayout = QtWidgets.QGridLayout()
messageLayout.addWidget(QtWidgets.QLabel(f"<img src='{iconPath}'>"), 0, 0, 1, 1, QtCore.Qt.AlignTop)
messageLayout.addWidget(QtWidgets.QLabel(f"<img width=256 src='{iconPath}'>"), 0, 0, 1, 1, QtCore.Qt.AlignTop)
aboutInfo = QtWidgets.QTextBrowser(messageWidget)
aboutInfo.setHtml(about)
messageLayout.addWidget(aboutInfo, 0, 1, 1, 1)
@@ -196,79 +195,89 @@ def UpdateThings():
# 生成 desktop 文件在启动器
def make_desktop_on_launcher():
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
return
if not CheckProgramIsInstall(wine[o1.currentText()]):
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
DisableButton(False)
try:
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
return
else: # 如果都有
if os.path.exists(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop"): # 判断目录是否有该文件,如果有
choose = QtWidgets.QMessageBox.question(widget, "提示", "文件已经存在,是否覆盖?") == QtWidgets.QMessageBox.Yes
if choose: # 如要覆盖
os.remove(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop") # 删除该文件
else: # 如不覆盖
return # 结束
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
option = ""
if setting["Architecture"] != "Auto":
option += f"WINEARCH={setting['Architecture']} "
if not setting["Debug"]:
option += "WINEDEBUG=-all "
write_txt(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
if not CheckProgramIsInstall(wine[o1.currentText()]):
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
DisableButton(False)
return
else: # 如果都有
if os.path.exists(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop"): # 判断目录是否有该文件,如果有
choose = QtWidgets.QMessageBox.question(widget, "提示", "文件已经存在,是否覆盖?") == QtWidgets.QMessageBox.Yes
if choose: # 如要覆盖
os.remove(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop") # 删除该文件
else: # 如不覆盖
return # 结束
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
option = ""
if setting["Architecture"] != "Auto":
option += f"WINEARCH={setting['Architecture']} "
if not setting["Debug"]:
option += "WINEDEBUG=-all "
write_txt(get_home() + "/.local/share/applications/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
Name={combobox1.currentText()}
Exec=env WINEPREFIX='{wineBottonPath}' {option} {wine[o1.currentText()]} '{e2.currentText()}' {setting["WineOption"]}
Icon={iconPath}
Type=Application
StartupNotify=true''') # 写入文本文档
shellHistory.append(combobox1.currentText()) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json", str(json.dumps(ListToDictionary(shellHistory)))) # 将历史记录的数组转换为字典并写入
combobox1.clear()
combobox1.addItems(shellHistory)
QtWidgets.QMessageBox.information(widget, "提示", "生成完成!") # 显示完成对话框
shellHistory.append(combobox1.currentText()) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json", str(json.dumps(ListToDictionary(shellHistory)))) # 将历史记录的数组转换为字典并写入
combobox1.clear()
combobox1.addItems(shellHistory)
QtWidgets.QMessageBox.information(widget, "提示", "生成完成!") # 显示完成对话框
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(widget, "错误", f"快捷方式创建失败,错误如下:\n{traceback.format_exc()}")
# 生成 desktop 文件在桌面
# (第四个按钮的事件)
def make_desktop_on_desktop():
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
return
if not CheckProgramIsInstall(wine[o1.currentText()]):
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
DisableButton(False)
try:
if combobox1.currentText() == "" or e2.currentText() == "": # 判断文本框是否有内容
QtWidgets.QMessageBox.information(widget, "提示", "没有填写需要使用 exe 应用或保存的文件名")
return
else: # 如果都有
if os.path.exists(get_desktop_path() + "/" + combobox1.currentText() + ".desktop"): # 判断目录是否有该文件,如果有
choose = QtWidgets.QMessageBox.question(widget, "提示", "文件已经存在,是否覆盖?") == QtWidgets.QMessageBox.Yes
if choose: # 如要覆盖
os.remove(get_desktop_path() + "/" + combobox1.currentText() + ".desktop") # 删除该文件
else: # 如不覆盖
return # 结束
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
os.mknod(get_desktop_path() + "/" + combobox1.currentText() + ".desktop")
option = ""
if setting["Architecture"] != "Auto":
option += f"WINEARCH={setting['Architecture']} "
if not setting["Debug"]:
option += "WINEDEBUG=-all "
write_txt(get_desktop_path() + "/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
if not CheckProgramIsInstall(wine[o1.currentText()]):
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine是否继续使用这个 wine 写入?") == QtWidgets.QMessageBox.No:
DisableButton(False)
return
else: # 如果都有
if os.path.exists(get_desktop_path() + "/" + combobox1.currentText() + ".desktop"): # 判断目录是否有该文件,如果有
choose = QtWidgets.QMessageBox.question(widget, "提示", "文件已经存在,是否覆盖?") == QtWidgets.QMessageBox.Yes
if choose: # 如要覆盖
os.remove(get_desktop_path() + "/" + combobox1.currentText() + ".desktop") # 删除该文件
else: # 如不覆盖
return # 结束
if e1.currentText() == "":
wineBottonPath = setting["DefultBotton"]
else:
wineBottonPath = e1.currentText()
if not os.path.exists(get_desktop_path()):
os.makedirs(get_home())
os.mknod(get_desktop_path() + "/" + combobox1.currentText() + ".desktop")
option = ""
if setting["Architecture"] != "Auto":
option += f"WINEARCH={setting['Architecture']} "
if not setting["Debug"]:
option += "WINEDEBUG=-all "
write_txt(get_desktop_path() + "/" + combobox1.currentText() + ".desktop", f'''[Desktop Entry]
Name={combobox1.currentText()}
Exec=env WINEPREFIX='{wineBottonPath}' {option} {wine[o1.currentText()]} '{e2.currentText()}' {setting["WineOption"]}
Icon={iconPath}
Type=Application
StartupNotify=true''') # 写入文本文档
shellHistory.append(combobox1.currentText()) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json", str(json.dumps(ListToDictionary(shellHistory)))) # 将历史记录的数组转换为字典并写入
combobox1.clear()
combobox1.addItems(shellHistory)
QtWidgets.QMessageBox.information(widget, "提示", "生成完成!") # 显示完成对话框
shellHistory.append(combobox1.currentText()) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json", str(json.dumps(ListToDictionary(shellHistory)))) # 将历史记录的数组转换为字典并写入
combobox1.clear()
combobox1.addItems(shellHistory)
QtWidgets.QMessageBox.information(widget, "提示", "生成完成!") # 显示完成对话框
except:
traceback.print_exc()
QtWidgets.QMessageBox.critical(widget, "错误", f"快捷方式创建失败,错误如下:\n{traceback.format_exc()}")
# 数组转字典
def ListToDictionary(list):
@@ -278,7 +287,7 @@ def ListToDictionary(list):
return dictionary
def CleanProgramHistory():
if QtWidgets.QMessageBox.question(title="警告", message="删除后将无法恢复,你确定吗?\n删除后软件将会自动重启。") == QtWidgets.QMessageBox.Yes:
if QtWidgets.QMessageBox.question(widget, "警告", "删除后将无法恢复,你确定吗?\n删除后软件将会自动重启。") == QtWidgets.QMessageBox.Yes:
shutil.rmtree(get_home() + "/.config/deepin-wine-runner")
ReStartProgram()
@@ -357,7 +366,7 @@ def RunWineProgram(wineProgram, history = False, Disbled = True):
global runProgram
DisableButton(True)
if not CheckProgramIsInstall(wine[o1.currentText()]):
if QtWidgets.QMessageBox.question(title="提示", message="检查到您未安装这个 wine是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No:
if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No:
DisableButton(False)
return
returnText.setText("")
@@ -779,7 +788,7 @@ class GetDllFromWindowsISO:
def CopyDll():
choose = GetDllFromWindowsISO.dllList.selectionModel().selectedIndexes()[0].data()
if os.path.exists(f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}"):
if QtWidgets.QMessageBox.question(title="提示", message=f"DLL {choose} 已经存在,是否覆盖?") == QtWidgets.QMessageBox.No:
if QtWidgets.QMessageBox.question(widget, "提示", f"DLL {choose} 已经存在,是否覆盖?") == QtWidgets.QMessageBox.No:
return
try:
shutil.copy(f"/tmp/wine-runner-getdll/i386/{choose[:-1]}_", f"{GetDllFromWindowsISO.wineBottonPath}/drive_c/windows/system32/{choose}")
@@ -925,7 +934,7 @@ except:
# 程序信息
###########################
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
iconPath = "{}/icon.png".format(programPath)
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
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"
information = json.loads(readtxt(f"{programPath}/information.json"))
version = information["Version"]
@@ -939,20 +948,16 @@ tips = '''提示:
exe路径\' 参数 \'
即可(单引号需要输入)
5、wine 容器如果没有指定,则会默认为 ~/.wine'''
updateThingsString = '''※1、界面大改造,从使用 Tkinter 改为 Qt参考了 @134******28 和 @sgb76 提供的设计方案和代码
※2、添加了基于 UOS 生态适配活动打包脚本的打包器,以及基于 Virtualbox 的简易 Windows 镜像安装工具
※3、将 pip 由阿里源改为华为源,提升下载安装速度,并删除使用 pip 下载库的功能(已不需要,废弃)
4、添加 @delsin 和 @神末shenmo 建议的 postrm 脚本
5、优化多屏窗口居中问题
6、修复 1.6.0 程序无法保存设置的问题
7、修复 1.6.0 的更新程序无法正常更新的问题
8、升级 Geek Uninstaller 版本
updateThingsString = '''※1、更换为 @PossibleVing 提供的程序图标
※2、修改了统信 Wine 生态适配活动的脚本,支持在非 UOS 系统打包
※3、修复了打包器在打包应用未指定图标的情况下显示对话框后强制退出的问题
4、修改 .net framework 3.5 的安装包,从在线版改为本地版
'''
for i in information["Thank"]:
thankText += f"{i}\n"
updateTime = "2022年07月18日"
updateTime = "2022年07月20日"
about = f'''<h1>关于</h1>
<pre>一个基于 Python3 的 tkinter 制作的 wine 运行器
<pre>一个基于 Python3 的 Qt 制作的 wine 运行器
版本:{version}
适用平台:{goodRunSystem}
@@ -978,7 +983,6 @@ updateThings = "{} 更新内容:\n{}\n更新时间{}".format(version, updat
###########################
# 窗口创建
###########################
# 因为没有完全改完,所以需要这些东西来兼容 tkinter 的主题
# 读取主题
# Qt 窗口
app = QtWidgets.QApplication(sys.argv)
@@ -1133,7 +1137,7 @@ w2 = QtWidgets.QAction("安装常见字体")
w3 = QtWidgets.QAction("安装自定义字体")
w4 = QtWidgets.QAction("删除选择的 Wine 容器")
w5 = QtWidgets.QAction("打包 wine 应用")
w6 = QtWidgets.QAction("使用官方 Wine 适配活动的脚本进行打包测试只支持UOS")
w6 = QtWidgets.QAction("使用官方 Wine 适配活动的脚本进行打包")
w7 = QtWidgets.QAction("从镜像获取DLL只支持Windows XP、Windows Server 2003官方安装镜像")
wineOption.addAction(w1)
wineOption.addAction(w2)
@@ -1272,7 +1276,7 @@ hm1_1.triggered.connect(lambda: webbrowser.open_new_tab("https://gitee.com/gfdgd
window.resize(widget.frameGeometry().width() * 2, widget.frameGeometry().height())
widget.setLayout(mainLayout)
window.setWindowTitle(title)
window.setWindowIcon(QtGui.QIcon(f"{programPath}/icon.png"))
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
widget.show()
window.show()

View File

@@ -55,7 +55,7 @@ def get_home()->"获取用户主目录":
###########################
# 程序信息
###########################
iconPath = "{}/icon.png".format(os.path.split(os.path.realpath(__file__))[0])
iconPath = "{}/deepin-wine-runner.svg".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"]

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -1,5 +1,5 @@
{
"Version": "1.7.0",
"Version": "1.7.1",
"Thank": [
"感谢 @a2035274 @虚幻的早晨 https://bbs.deepin.org/post/238301",
"感谢 @zhangs https://bbs.deepin.org/post/227948",
@@ -9,6 +9,7 @@
"感谢 @delsin 和 @神末shenmo 在 deepin 论坛提供打包器打包的 deb 包自动删除容器的建议",
"感谢 @GershonWang 在 https://github.com/gfdgd-xi/deep-wine-runner/issues/1 提供窗口居中的建议",
"感谢 @134******28 和 @sgb76 提供的新程序 GUI 布局和实现代码",
"感谢 @PossibleVing 提供的新版应用图标",
"感谢统信在 Wine 生态适配活动中提供的打包脚本",
"",
"可以从上面的各种解决方案更好的学习 Wine 生态适配,也可以看 deepin 论坛板块 https://bbs.deepin.org/module/detail/116 进行学习,最后也向各位有进行 Wine 生态适配的大佬进行由衷的感谢!",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -4,7 +4,7 @@ Encoding=UTF-8
Categories=System;Wine;
Version=1.7.0
Exec=/usr/bin/deepin-wine-package-builder "~/.wine" %F
Icon=/opt/apps/deepin-wine-runner/icon.png
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder
Name[zh]=Wine 打包器
Comment=Wine Package Builder

View File

@@ -4,7 +4,7 @@ Encoding=UTF-8
Categories=System;Wine;
Version=1.7.0
Exec=/usr/bin/deepin-wine-packager-with-script
Icon=/opt/apps/deepin-wine-runner/icon.png
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder For UOS
Name[zh]=Wine 打包器(基于活动脚本)
Comment=Wine Package Builder For UOS

View File

@@ -4,9 +4,9 @@ Encoding=UTF-8
Categories=System;Wine;
Version=1.7.0
Exec=/opt/apps/deepin-wine-runner/RunVM.sh %F
Icon=/opt/apps/deepin-wine-runner/icon.png
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Setting VirtualMachine
Name[zh]=设置虚拟机
Name[zh]=设置 Windows 虚拟机
Comment=Setting VirtualMachine
Comment[zh]=设置虚拟机
Terminal=false

View File

@@ -4,7 +4,7 @@ Encoding=UTF-8
Categories=System;
Version=1.7.0
Exec=/opt/apps/deepin-wine-runner/StartVM.sh %F
Icon=/opt/apps/deepin-wine-runner/icon.png
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Start Windows VirtualMachine
Name[zh]=开启 Windows 虚拟机
Comment=Start Windows VirtualMachine

View File

@@ -4,7 +4,7 @@ Encoding=UTF-8
Categories=System;Wine;
Version=1.7.0
Exec=/usr/bin/deepin-wine-runner %F
Icon=/opt/apps/deepin-wine-runner/icon.png
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Runner
Name[zh]=Wine 运行器
Comment=Wine Runner