diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index 31c851e..9ff7c7e 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -169,8 +169,8 @@ class Runexebutton_threading(QtCore.QThread): wineUsingOption = "" if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") if setting["TerminalOpen"]: @@ -290,8 +290,8 @@ def make_desktop_on_launcher(): wineUsingOption = "" if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") if o1.currentText() == "基于 exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 box86 的 deepin-wine6-stable": @@ -352,8 +352,8 @@ def make_desktop_on_desktop(): wineUsingOption = "" if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") if not os.path.exists(get_desktop_path()): @@ -479,8 +479,8 @@ class RunWineProgramThread(QtCore.QThread): wineUsingOption = "" if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") if setting["TerminalOpen"]: @@ -543,8 +543,8 @@ class RunWinetricksThread(QtCore.QThread): wineUsingOption = "" if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") if setting["TerminalOpen"]: @@ -576,8 +576,8 @@ def RunWinetricks(): return if o1.currentText() == "基于 box86 的 deepin-wine6-stable" or o1.currentText() == "基于 exagear 的 deepin-wine6-stable": if not os.path.exists(f"{programPath}/dlls-arm"): - if os.system(f"7z x \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dlls-arm.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dlls-arm.7z") returnText.setText("") @@ -643,8 +643,8 @@ def InstallMSXML(): def InstallDXVK(): if not os.path.exists(f"{programPath}/dxvk"): - if os.system(f"7z x \"{programPath}/dxvk.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dxvk.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dxvk.7z") if e1.currentText() == "": @@ -659,8 +659,8 @@ def InstallDXVK(): def UninstallDXVK(): if not os.path.exists(f"{programPath}/dxvk"): - if os.system(f"7z x \"{programPath}/dxvk.7z\" -o\"{programPath}\""): - QtWidgets.QMessageBox(widget, "错误", "无法解压资源") + if os.system(f"7z x -y \"{programPath}/dxvk.7z\" -o\"{programPath}\""): + QtWidgets.QMessageBox.critical(widget, "错误", "无法解压资源") return os.remove(f"{programPath}/dxvk.7z") if e1.currentText() == "": @@ -1793,36 +1793,16 @@ exe路径\' 参数 \' 千万不要中断后不删除源的情况下 apt upgrade !!!中断后只需重新打开脚本输入 repair 或者随意安装一个 Wine(会自动执行恢复操作)即可 以及此脚本安装的 Wine 无法保证 100% 能使用,以及副作用是会提示 N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。''' -updateThingsString = '''

2.2.0-1 更新内容

-※1、修复基于生态适配活动打包器对话框过多并修改了小提示内容 -

2.2.0 更新内容

-※1、Dll 提取工具支持 NT 6.X 及以上版本的 Dll 提取并优化了提示文本 -※2、支持卸载后自动删除缓存/配置文件(删除配置文件只限 purge 参数删除) -※3、DEBUG 模式输出更多信息以方便调试(原本只输出 pid、Err) -※4、支持安装 msi 文件 -※5、修复无法正常评分的问题 -※6、修复 QQ、TIM 安装后无法正常生成快捷方式的问题 -※7、基于生态适配活动的打包器更换为 spark-wine-helper 以及添加自动删除残留脚本 -※8、打包器支持从 deb 文件读取信息 -※9、修复在 UOS 专业版(鲲鹏)无法正常运行的问题以及组件安装功能无法正常执行安装命令的问题 -※10、修复出现星火应用商店和官方应用商店反复提示更新死循环的问题 -※11、新增评分分数预测功能(不准) -※12、更换程序接口 -※13、将 WineHQ 的源换为国内源 -14、更新组件安装的离线列表 -15、不再强制依赖深度终端,只做推荐安装 -16、基于生态活动适配脚本的打包器在打包完成后会弹出对话框提示打包完成 -17、优化打包器的 spark wine helper 依赖设置方式 -18、新增 RegShot(注册表比对工具) -19、添加 Wine 运行器评分数据的搜索功能 -以下更新内容旧版本也适用(只限 2.1.0 及以上版本) -※1、在“安装更多Wine”的Wine安装工具中上新 Wine -※2、云 Dll 工具上新 Dll -※3、VCPP、net 运行库安装工具新增运行库 +updateThingsString = '''※1、自动配置解释器支持 bash 语法(新版底层调用 bash,旧版任然使用旧版解析引擎) +※2、修复缺失 wimtools 依赖导致无法正常安装的问题 +※3、修复基于生态适配活动脚本打包器对话框过多影响使用的问题,并支持指定不同的包名和容器名 +※4、7z 文件解压不会自动替换文件然后卡死以及因此导致程序闪退的问题 +5、支持通过 exe 路径自动生成 Wine 容器路径 +6、支持禁用/启用 wine 容器是否生成快捷方式的功能 ''' for i in information["Thank"]: thankText += f"{i}\n" -updateTime = "2022年09月24日" +updateTime = "2022年09月30日" about = f'''

关于

一个能让Linux用户更加方便运行Windows应用的程序,内置了对wine图形化的支持和各种Wine工具和自制Wine程序打包器、运行库安装工具等等

同时也内置了基于VirtualBox制作的小白Windows虚拟机安装工具,可以做到只需要用户下载系统镜像并点击安装即可,无需顾及虚拟机安装、创建、虚拟机的分区等等

@@ -2146,8 +2126,12 @@ installDxvk = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "安装 D uninstallDxvk = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "卸载 DXVK")) dxvkMenu.addAction(installDxvk) dxvkMenu.addAction(uninstallDxvk) -wineOption.addSeparator() wineOption.addAction(deleteDesktopIcon) +settingWineBottleCreateLink = wineOption.addMenu(QtCore.QCoreApplication.translate("U", "允许/禁止指定 wine 容器生成快捷方式")) +enabledWineBottleCreateLink = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "允许指定 wine 容器生成快捷方式")) +disbledWineBottleCreateLink = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "禁止指定 wine 容器生成快捷方式")) +settingWineBottleCreateLink.addAction(enabledWineBottleCreateLink) +settingWineBottleCreateLink.addAction(disbledWineBottleCreateLink) w1.triggered.connect(OpenWineBotton) w2.triggered.connect(InstallWineFont) w3.triggered.connect(OpenWineFontPath) @@ -2181,6 +2165,8 @@ wm4_2.triggered.connect(lambda: os.system(f"'{programPath}/launch.sh' deepin-ter installDxvk.triggered.connect(InstallDXVK) uninstallDxvk.triggered.connect(UninstallDXVK) deleteDesktopIcon.triggered.connect(DeleteDesktopIcon) +enabledWineBottleCreateLink.triggered.connect(lambda: RunWineProgram("reg' delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe '/f")) +disbledWineBottleCreateLink.triggered.connect(lambda: RunWineProgram("reg' add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe '/f")) virtualMachine = menu.addMenu(QtCore.QCoreApplication.translate("U", "虚拟机(&V)")) v1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "使用 Virtualbox 虚拟机运行 Windows 应用")) diff --git a/deb/opt/apps/deepin-wine-runner/package-script.zip b/deb/opt/apps/deepin-wine-runner/package-script.zip index d55821c..73dfbeb 100755 Binary files a/deb/opt/apps/deepin-wine-runner/package-script.zip and b/deb/opt/apps/deepin-wine-runner/package-script.zip differ diff --git a/deb/opt/apps/deepin-wine-runner/wine/installwine b/deb/opt/apps/deepin-wine-runner/wine/installwine index 2dae947..34999c1 100755 --- a/deb/opt/apps/deepin-wine-runner/wine/installwine +++ b/deb/opt/apps/deepin-wine-runner/wine/installwine @@ -15,8 +15,11 @@ import sys import json import traceback import requests +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../") +from Model import * from PyQt5 import QtCore, QtGui, QtWidgets - +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string # UI 布局(自动生成) class Ui_MainWindow(object): def setupUi(self, MainWindow): @@ -182,10 +185,11 @@ class DownloadThread(QtCore.QThread): shellFile = open("/tmp/depein-wine-runner-wine-install.sh", "w") shellFile.write(shellCommand) shellFile.close() - process = QtCore.QProcess() - command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"] - process.start(f"{programPath}/../launch.sh", command) - process.waitForFinished() + #process = QtCore.QProcess() + #command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"] + #process.start(f"{programPath}/../launch.sh", command) + #process.waitForFinished() + OpenTerminal("bash /tmp/depein-wine-runner-wine-install.sh") self.Finish.emit() except: traceback.print_exc() @@ -274,7 +278,6 @@ if __name__ == "__main__": localJsonList = [] internetJsonList = [] internetWineSource = "https://code.gitlink.org.cn/gfdgd_xi/wine-mirrors/raw/branch/master/" - programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string app = QtWidgets.QApplication(sys.argv) # 读取翻译 if not get_now_lang() == "zh_CN.UTF-8": diff --git a/deepin-wine-packager.py b/deepin-wine-packager.py index fc04b0c..809beb8 100755 --- a/deepin-wine-packager.py +++ b/deepin-wine-packager.py @@ -818,28 +818,29 @@ fi # 设置容器 ############### self.label.emit("正在设置 wine 容器") - os.chdir(programPath) - if cleanBottonByUOS.isChecked(): - self.run_command(f"WINE='{debInformation[debArch.currentIndex()]['Wine']}' '{programPath}/cleanbottle.sh' '{b}'") - os.chdir(b) - # 对用户目录进行处理 - self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg") - os.chdir(f"{b}/drive_c/users") - if os.path.exists(f"{b}/drive_c/users/@current_user@"): - self.run_command(f"rm -rfv '{b}/drive_c/users/@current_user@'") - self.run_command(f"mv -fv '{os.getlogin()}' @current_user@") - # 如果缩放文件 scale.txt 存在,需要移除以便用户自行调节缩放设置 - if os.path.exists(f"{b}/scale.txt"): - os.remove(f"{b}/scale.txt") - # 删除因为脚本失误导致用户目录嵌套(如果存在) - if os.path.exists(f"{b}{b}/drive_c/users/@current_user@/@current_user@"): - shutil.rmtree(f"{b}{b}/drive_c/users/@current_user@/@current_user@") - # 删除无用的软链 - self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/我的'*") - self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/My '*") - self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Desktop'") - self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Downloads'") - self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Templates'") + if e6_text.text()[-3: ] != ".7z": + os.chdir(programPath) + if cleanBottonByUOS.isChecked(): + self.run_command(f"WINE='{debInformation[debArch.currentIndex()]['Wine']}' '{programPath}/cleanbottle.sh' '{b}'") + os.chdir(b) + # 对用户目录进行处理 + self.run_command("sed -i \"s#$USER#@current_user@#\" ./*.reg") + os.chdir(f"{b}/drive_c/users") + if os.path.exists(f"{b}/drive_c/users/@current_user@"): + self.run_command(f"rm -rfv '{b}/drive_c/users/@current_user@'") + self.run_command(f"mv -fv '{os.getlogin()}' @current_user@") + # 如果缩放文件 scale.txt 存在,需要移除以便用户自行调节缩放设置 + if os.path.exists(f"{b}/scale.txt"): + os.remove(f"{b}/scale.txt") + # 删除因为脚本失误导致用户目录嵌套(如果存在) + if os.path.exists(f"{b}{b}/drive_c/users/@current_user@/@current_user@"): + shutil.rmtree(f"{b}{b}/drive_c/users/@current_user@/@current_user@") + # 删除无用的软链 + self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/我的'*") + self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/My '*") + self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Desktop'") + self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Downloads'") + self.run_command(f"rm -fv '{b}/drive_c/users/@current_user@/Templates'") os.chdir(programPath) ############### # 压缩 Wine @@ -858,8 +859,8 @@ fi ############### self.label.emit("正在打包 wine 容器") # 都有 7z 了为什么要打包呢? - if e1_text.text()[-3: ] == ".7z": - shutil.copy(e1_text.text(), f"{debPackagePath}/opt/apps/{e1_text.text()}/files/files.7z") + if e6_text.text()[-3: ] == ".7z": + shutil.copy(e6_text.text(), f"{debPackagePath}/opt/apps/{e1_text.text()}/files/files.7z") else: self.run_command("7z a {}/opt/apps/{}/files/files.7z {}/*".format(debPackagePath, e1_text.text(), b)) ############### @@ -1076,6 +1077,8 @@ def ReadDeb(unzip = False): # 获取路径 debPath = QtWidgets.QFileDialog.getOpenFileName(window, "读取 deb 包", get_home(), "deb包(*.deb);;所有文件(*.*)")[0] print(debPath) + if debPath == "": + return # 分类讨论 path = f"/tmp/deb-unzip-{random.randint(0, 1000)}" # 新建文件夹 @@ -1234,6 +1237,66 @@ def ReadDeb(unzip = False): wineVersion.setCurrentText(wineValue[dependsItem]) except: print(f"忽略行:{i}") + elif os.path.exists(f"{path}/opt/apps/{package}/files/run_with_box86.sh"): + file = open(f"{path}/opt/apps/{package}/files/run_with_box86.sh", "r") + items = file.read().splitlines() + file.close() + for i in items: + # 按行解析 + if i.replace(" ", "").replace("\n", "") == "": + # 空行,忽略 + continue + # 忽略 export + line = i.replace("export ", "") + # 忽略注释 + if "#" in line: + line = line[:line.index("#")] + # 判断是否合法 + try: + name = line[:line.index("=")].strip() + value = line[line.index("=") + 1:].replace("\"", "").strip() + #lnkMap[name].setText(value) + if name in lnkMap: + lnkMap[name].setText(value) + continue + # 其它的特殊情况判断 + if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh": + # helper + chooseWineHelperValue.setChecked(True) + if name == "APPRUN_CMD" and value in wineValue: + wineVersion.setCurrentText(wineValue[dependsItem]) + except: + print(f"忽略行:{i}") + elif os.path.exists(f"{path}/opt/apps/{package}/files/run_with_exagear.sh"): + file = open(f"{path}/opt/apps/{package}/files/run_with_exagear.sh", "r") + items = file.read().splitlines() + file.close() + for i in items: + # 按行解析 + if i.replace(" ", "").replace("\n", "") == "": + # 空行,忽略 + continue + # 忽略 export + line = i.replace("export ", "") + # 忽略注释 + if "#" in line: + line = line[:line.index("#")] + # 判断是否合法 + try: + name = line[:line.index("=")].strip() + value = line[line.index("=") + 1:].replace("\"", "").strip() + #lnkMap[name].setText(value) + if name in lnkMap: + lnkMap[name].setText(value) + continue + # 其它的特殊情况判断 + if name == "START_SHELL_PATH" and value == "/opt/deepinwine/tools/spark_run_v4.sh": + # helper + chooseWineHelperValue.setChecked(True) + if name == "APPRUN_CMD" and value in wineValue: + wineVersion.setCurrentText(wineValue[dependsItem]) + except: + print(f"忽略行:{i}") diff --git a/package-script.zip b/package-script.zip index d55821c..73dfbeb 100755 Binary files a/package-script.zip and b/package-script.zip differ diff --git a/wine/installwine b/wine/installwine index 2dae947..34999c1 100755 --- a/wine/installwine +++ b/wine/installwine @@ -15,8 +15,11 @@ import sys import json import traceback import requests +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../") +from Model import * from PyQt5 import QtCore, QtGui, QtWidgets - +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string # UI 布局(自动生成) class Ui_MainWindow(object): def setupUi(self, MainWindow): @@ -182,10 +185,11 @@ class DownloadThread(QtCore.QThread): shellFile = open("/tmp/depein-wine-runner-wine-install.sh", "w") shellFile.write(shellCommand) shellFile.close() - process = QtCore.QProcess() - command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"] - process.start(f"{programPath}/../launch.sh", command) - process.waitForFinished() + #process = QtCore.QProcess() + #command = ["deepin-terminal", "-e", "bash", "/tmp/depein-wine-runner-wine-install.sh"] + #process.start(f"{programPath}/../launch.sh", command) + #process.waitForFinished() + OpenTerminal("bash /tmp/depein-wine-runner-wine-install.sh") self.Finish.emit() except: traceback.print_exc() @@ -274,7 +278,6 @@ if __name__ == "__main__": localJsonList = [] internetJsonList = [] internetWineSource = "https://code.gitlink.org.cn/gfdgd_xi/wine-mirrors/raw/branch/master/" - programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string app = QtWidgets.QApplication(sys.argv) # 读取翻译 if not get_now_lang() == "zh_CN.UTF-8":