From 08dbe1cb808e5ccf74bad18a3f44445773a14a23 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sun, 4 Dec 2022 16:13:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=96=87=E6=A1=88=E5=92=8C?= =?UTF-8?q?=E7=AE=80=E6=98=93=E6=89=93=E5=8C=85=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deepin-wine-easy-packager.py | 23 +++++++++++++++++------ deepin-wine-packager.py | 2 +- information.json | 1 + mainwindow.py | 19 ++++++------------- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/deepin-wine-easy-packager.py b/deepin-wine-easy-packager.py index b771d23..077d24a 100755 --- a/deepin-wine-easy-packager.py +++ b/deepin-wine-easy-packager.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 import os import sys import json @@ -399,7 +400,15 @@ class RunThread(QtCore.QThread): ############# 后面将全部调用 deepin wine6 stable 进行操作 exeName = os.path.basename(exePath.text()) # 暂定 - debPackageName = "spark-" + xpinyin.Pinyin().get_pinyin(os.path.splitext(exeName)[0].replace(" ", "")).lower().replace("--", "-").replace(" ", "").replace("_", "-") + packageName = xpinyin.Pinyin().get_pinyin(os.path.splitext(exeName)[0].replace(" ", ""), "").lower().replace(" ", "").replace("_", ".").replace("-", ".").replace("..", ".") + + if " " in packageName: + packageName = "" + for i in os.path.splitext(exeName)[0].split(" "): + packageName += xpinyin.Pinyin().get_pinyin(i).lower().replace(" ", "").replace("_", ".").replace("-", ".").replace("..", ".") + "." + print(packageName) + packageName = packageName[:-1] + debPackageName = "com." + packageName + ".spark" debPackageVersion = "1.0.0" programIconPath = f"/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/{debPackageName}.png" debMaintainer = os.getlogin() @@ -430,6 +439,8 @@ class RunThread(QtCore.QThread): lnkList = GetLnkDesktop(lnkPath) if len(lnkList) <= 0: self.error.emit("无法识别到任何 lnk 快捷方式") + self.RunCommand(f"rm -rfv '{debBuildPath}' > /dev/null") + self.RunCommand(f"rm -rfv '{bottlePath}' > /dev/null") self.disbledAll.emit(False) return # 选择最优 lnk @@ -457,7 +468,7 @@ class RunThread(QtCore.QThread): exePathInBottle = rightLnk[1] exeName = os.path.splitext(os.path.basename(folderExePath))[0] exePathInSystem = rightLnk[1].replace("\\", "/").replace("c:", f"{bottlePath}/drive_c") - debPackageVersion = self.GetEXEVersion(exePathInBottle) + debPackageVersion = self.GetEXEVersion(exePathInSystem) cpNow = False for i in iconList: path = i[1].replace("wineBottonPath", bottlePath).lower() @@ -478,11 +489,11 @@ class RunThread(QtCore.QThread): exePathInBottle = f"c:/Program Files/{os.path.basename(folderExePath)}/{exeName}" exeName = os.path.splitext(os.path.basename(os.path.basename(exePath.text())))[0] self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/'") - self.RunCommand(f"'{programPath}/wrestool' '{exePathInBottle}' -x -t 14 > '{debBuildPath}/{programIconPath}'") - debPackageVersion = self.GetEXEVersion(exePathInBottle) + self.RunCommand(f"'{programPath}/wrestool' '{exePath.text()}' -x -t 14 > '{debBuildPath}/{programIconPath}'") # 拷贝文件到容器 self.RunCommand(f"cp -rv '{folderExePath}' '{bottlePath}/drive_c/Program Files'") - debDescription = f"{exeName} By Deepin Wine 6 Stable And Build By Wine Runner" + debPackageVersion = self.GetEXEVersion(exePath.text()) + debDescription = f"{exeName} By Deepin Wine 6 Stable And Build By Wine Runner Easy Packager" debDepends = "deepin-wine6-stable, spark-dwine-helper | store.spark-app.spark-dwine-helper, fonts-wqy-microhei, fonts-wqy-zenhei" self.RunCommand(f"mkdir -pv '{debBuildPath}/DEBIAN'") self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/files'") @@ -508,7 +519,7 @@ class RunThread(QtCore.QThread): ########### 打包容器 self.RunCommand(f"7z a '{bottlePackagePath}' '{bottlePath}/'*") ########### 生成文件内容 - buildProgramSize = getFileFolderSize(debBuildPath) + buildProgramSize = getFileFolderSize(debBuildPath) / 1000 replaceMap = [ ["@@@Package@@@", debPackageName], ["@@@Version@@@", debPackageVersion], diff --git a/deepin-wine-packager.py b/deepin-wine-packager.py index 6f97368..fbc9a26 100755 --- a/deepin-wine-packager.py +++ b/deepin-wine-packager.py @@ -1231,7 +1231,7 @@ fi # 获取文件大小 ################ self.label.emit("正在计算文件大小……") - size = int(getFileFolderSize(debPackagePath) / 1024) + size = int(getFileFolderSize(debPackagePath) / 1000) ################ # 写入文本文档 ################ diff --git a/information.json b/information.json index 9fe03a8..4bfb60f 100755 --- a/information.json +++ b/information.json @@ -1,6 +1,7 @@ { "Version": "2.5.0", "Thank": [ + "感谢 @鹤舞白沙 对程序文案进行优化以及编写《Wine运行器和Wine打包器傻瓜式使用教程(小白专用) 》", "感谢 @璀璨星空 提供的彩蛋图标", "感谢 @鹤舞白沙 专门为小白用户编写的使用 Wine 运行器非基于生态适配脚本的程序打包教程", "感谢 @牦牛儿苗 进行了龙芯 3a5000 平台的测试与移植", diff --git a/mainwindow.py b/mainwindow.py index 1c61bb9..f5c6a6f 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -2190,19 +2190,9 @@ exe路径\' 参数 \' 千万不要中断后不删除源的情况下 apt upgrade !!!中断后只需重新打开脚本输入 repair 或者随意安装一个 Wine(会自动执行恢复操作)即可 以及此脚本安装的 Wine 无法保证 100% 能使用,以及副作用是会提示; N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。''' -updateThingsString = '''※1、容器自动配置脚本 GUI 查看介绍使用 QWebEngineWidget,支持图片(非强制依赖,只做推荐); -※2、不基于生态适配活动脚本打包器跟进 arm 架构 2022年11月11日的 Wine 微信打包方式; -※3、支持多图标的程序打包; -※4、修复了安装更多 Wine 换源换了个寂寞的问题; -※5、修复安装更多 Wine 重新安装后列表丢失的问题; -※6、新增了对 Deepin 23 Alpha 优化的 Wine 安装器; -※7、新增 Dll 名称查询功能,可以查询对应 Dll 的作用; -※8、支持静态获取可执行文件可以调用的 Dll 并提供解决方案; -※9、支持移除指定的 .desktop 快捷方式; -※10、新增日志分析功能以及导出、上传日志功能; -11、修复了不基于生态适配活动脚本打包器在选择 arm 打包架构下容器自动删除脚本取消勾选无用的问题; -12、优化文案、新增友链; -13、提供了部分组件的测试功能。 +updateThingsString = '''※1、支持使用 Qemu + Chroot 跨运行 Wine 以及指定程序的功能; +※2、提供了简易打包器以用于打包简易 deb; +※3、支持下载配置过的 Qemu + Chroot 容器; ''' for i in information["Thank"]: thankText += f"{i}\n" @@ -2691,6 +2681,7 @@ help = menu.addMenu(QtCore.QCoreApplication.translate("U", "帮助(&H)")) runStatusWebSize = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "查询程序在 Wine 的运行情况")) h1 = help.addMenu(QtCore.QCoreApplication.translate("U", "程序官网")) h2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "小提示")) +wineRunnerHelp = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "Wine运行器和Wine打包器傻瓜式使用教程(小白专用) By 鹤舞白沙")) h3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新内容")) h4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "谢明名单")) h5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新这个程序")) @@ -2712,6 +2703,7 @@ h1.addAction(gitlab) h1.addAction(jihu) help.addSeparator() help.addAction(forumWebsize) +help.addAction(wineRunnerHelp) help.addAction(runStatusWebSize) help.addSeparator() help.addAction(h2) @@ -2744,6 +2736,7 @@ runStatusWebSize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdg forumWebsize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgdxi.flarum.cloud/")) h2.triggered.connect(helps) h3.triggered.connect(UpdateThings) +wineRunnerHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://bbs.deepin.org/post/246837")) h4.triggered.connect(ThankWindow) wikiHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-wiki")) easyHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://www.bilibili.com/video/BV1ma411972Y"))