From f2c358717eeeac5d9a19045f76fe520203da13de Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 24 Jan 2023 08:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DVCPP=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E5=99=A8=E6=97=A0=E6=B3=95=E5=AE=89=E8=A3=85=E7=AC=AC=E4=B8=80?= =?UTF-8?q?=E9=A1=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- InstallVisualCPlusPlus.py | 4 +- Makefile | 5 +- deb/opt/apps/deepin-wine-runner/AutoConfig.py | 1 - .../ConfigLanguareRunner.py | 55 ++++++-- deb/opt/apps/deepin-wine-runner/Mount.sh | 3 +- .../deepin-wine-runner/MountWithoutHome.sh | 3 +- .../deepin-wine-runner/deepin-wine-runner | 46 +++++-- deb/opt/apps/deepin-wine-runner/getxmlimg.py | 118 ++++++++++++++++++ .../apps/deepin-wine-runner/information.json | 3 +- .../deepin-wine-runner/package-script.zip | Bin 306745 -> 306745 bytes .../apps/deepin-wine-runner/wine/installwine | 2 +- package-script.zip | Bin 306745 -> 306745 bytes 12 files changed, 211 insertions(+), 29 deletions(-) create mode 100755 deb/opt/apps/deepin-wine-runner/getxmlimg.py diff --git a/InstallVisualCPlusPlus.py b/InstallVisualCPlusPlus.py index bb7e5f5..c74fa4a 100755 --- a/InstallVisualCPlusPlus.py +++ b/InstallVisualCPlusPlus.py @@ -19,10 +19,10 @@ try: "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/list.json", "http://gfdgdxi.msns.cn/wine-runner-list/vscpp/list.json" ] - netList = json.loads(requests.get().text) + netList = json.loads(requests.get(sourcesList[0]).text) except: netList = [ - ["VC6 运行库", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/VC6RedistSetup_deu.exe"], + ["VC6 运行库", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vscpp/VC6RedistSetup_deu.exe", "VC6RedistSetup_deu.exe"], ["2005 Service Pack 1 Redistributable Package MFC 安全更新", "https://download.microsoft.com/download/4/A/2/4A22001F-FA3B-4C13-BF4E-42EC249D51C4/vcredist_x86.EXE", "vcredist05_x86.exe"], ["2008 (VC++ 9.0) SP1 (不再支持) X86", "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x86.exe", "vcredist08_x86.exe"], ["2008 (VC++ 9.0) SP1 (不再支持) X64", "https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_x64.exe", "vcredist08_x86.exe"], diff --git a/Makefile b/Makefile index 0b05c3f..3170d80 100755 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ build: cp -rv DisabledOpengl.reg deb/opt/apps/deepin-wine-runner cp -rv EnabledOpengl.reg deb/opt/apps/deepin-wine-runner cp -rv geek.exe deb/opt/apps/deepin-wine-runner - cp -rv uengineapi deb/opt/apps/deepin-wine-runner + #cp -rv uengineapi deb/opt/apps/deepin-wine-runner cp -rv getxmlimg.py deb/opt/apps/deepin-wine-runner cp -rv ProgramFen.py deb/opt/apps/deepin-wine-runner cp -rv information.json deb/opt/apps/deepin-wine-runner @@ -93,6 +93,7 @@ build: cp -rv API deb/opt/apps/deepin-wine-runner cp -rv key deb/opt/apps/deepin-wine-runner python3 RemovePycacheFile.py + cp -rv deb /tmp/spark-deepin-wine-runner-builder ln -s /opt/apps/deepin-wine-runner/deepin-wine-packager.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-package-builder ln -s /opt/apps/deepin-wine-runner/deepin-wine-easy-packager.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-packager-easy-builder ln -s /opt/apps/deepin-wine-runner/deepin-wine-packager-with-script.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-packager-with-script @@ -112,7 +113,7 @@ build: ln -s /opt/apps/deepin-wine-runner/InstallNetFramework.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-runner-wine-netframework-installer ln -s /opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-runner-wine-vscppruntime-installer ln -s /opt/apps/deepin-wine-runner/deepin-wine-venturi-setter.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-venturi-setter - cp -rv deb /tmp/spark-deepin-wine-runner-builder + sudo chown -R root:root /tmp/spark-deepin-wine-runner-builder dpkg -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner.deb diff --git a/deb/opt/apps/deepin-wine-runner/AutoConfig.py b/deb/opt/apps/deepin-wine-runner/AutoConfig.py index 2f4c949..258d5a1 100755 --- a/deb/opt/apps/deepin-wine-runner/AutoConfig.py +++ b/deb/opt/apps/deepin-wine-runner/AutoConfig.py @@ -350,7 +350,6 @@ class ProgramRunStatusShow(): print(f"脚本:{name}") print(f"评论:{info}") try: - # res = requests.post(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0OjMwMjUwL1BpbmdMdW4=").decode("utf-8"), {"PinLun": info, "Version": name}).json() print(res) if res["ExitCode"]: diff --git a/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py b/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py index 61e4cfd..5b007a2 100755 --- a/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py +++ b/deb/opt/apps/deepin-wine-runner/ConfigLanguareRunner.py @@ -12,6 +12,8 @@ import sys import time import json import random +# 阉割 Android 应用安装功能 +#import uengineapi import platform import traceback import webbrowser @@ -129,7 +131,8 @@ class Command(): "installother", "decompressionbottle", "programforum", - "installmsi" + "installmsi", + "installapk" ] def __init__(self, commandString: str) -> None: @@ -236,7 +239,7 @@ class Command(): return 0 def StopDll(self) -> int: - os.system(f"WINEPREFIX='{self.wineBottonPath}' '{self.wine}' reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(self.command[1])[0]} /f") + return os.system(f"WINEPREFIX='{self.wineBottonPath}' '{self.wine}' reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v {os.path.splitext(self.command[1])[0]} /f") def CreateBotton(self): self.command = ["bat", "exit"] @@ -349,9 +352,11 @@ class Command(): file = open(self.command[1], "r") print(file.read()) file.close() + return 0 except: print("文件读取错误") Debug() + return 1 def Taskmgr(self): self.command = ["bat", "taskmgr"] @@ -362,7 +367,7 @@ class Command(): return self.Bat() def Killall(self): - os.system(f"killall -9 {self.command[1]}") + return os.system(f"killall -9 {self.command[1]}") def KillallWineServer(self): command = ["WINEPREFIX='($WINEPREFIX)'", "($WINE)", "-k"] @@ -385,19 +390,19 @@ class Command(): def EnabledWineBottleCreateLink(self): self.command = ["bat", "reg", "delete", "HKEY_CURRENT_USER\Software\Wine\DllOverrides", "/v", "winemenubuilder.exe", "/f"] - self.Bat() + return self.Bat() def DisbledWineBottleCreateLink(self): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Wine\DllOverrides", "/v", "winemenubuilder.exe", "/f"] - self.Bat() + return self.Bat() def DisbledWineCrashDialog(self): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Wine\WineDbg", "/v", "ShowCrashDialog", "/t", "REG_DWORD", "/d", "00000000", "/f"] - self.Bat() + return self.Bat() def EnabledWineCrashDialog(self): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Wine\WineDbg", "/v", "ShowCrashDialog", "/t", "REG_DWORD", "/d", "00000001", "/f"] - self.Bat() + return self.Bat() def EnabledHttpProxy(self): proxyServerAddress = self.command[1] @@ -405,7 +410,7 @@ class Command(): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "/v", "ProxyEnable", "/t", "REG_DWORD", "/d", "00000001", "/f"] self.Bat() self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "/v", "ProxyServer", "/d", f"{proxyServerAddress}:{port}", "/f"] - self.Bat() + return self.Bat() def DecompressionBottle(self): tempDebDir = f"/tmp/wine-runner-unpack-deb-{random.randint(0, 1000)}" @@ -423,7 +428,7 @@ class Command(): def DisbledHttpProxy(self): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "/v", "ProxyEnable", "/t", "REG_DWORD", "/d", "00000000", "/f"] - self.Bat() + return self.Bat() def InstallVB(self): import InstallVisualBasicRuntime @@ -435,11 +440,28 @@ class Command(): def ProgramForum(self): webbrowser.open_new_tab("https://gfdgdxi.flarum.cloud/") + return def InstallMSI(self): self.command = ["bat", "msiexec", "/i", self.command[1]] return self.Bat() + def InstallApk(self): + if os.system("which uengine > /dev/null"): + print("未安装 UEngine,无法使用该命令") + return 1 + apk = uengineapi.APK(self.command[1]) + result = apk.install() + homePath = os.getenv("HOME") + if not os.path.exists(f"{homePath}/.local/share/applications/uengine"): + os.makedirs(f"{homePath}/.local/share/applications/uengine") + if not os.path.exists(f"{homePath}/.local/share/icons/hicolor/apps"): + os.makedirs(f"{homePath}/.local/share/icons/hicolor/apps") + package = apk.packageName() + apk.saveApkIcon(f"{homePath}/.local/share/icons/hicolor/apps/{package}.png") + apk.saveDesktopFile(f"{homePath}/.local/share/applications/uengine/{package}.desktop", f"{homePath}/.local/share/icons/hicolor/apps/{package}.png") + return result + # 可以运行的命令的映射关系 # 可以被使用的命令的映射 commandList = { @@ -485,7 +507,8 @@ class Command(): "installother": InstallOther, "decompressionbottle": DecompressionBottle, "programforum": ProgramForum, - "installmsi": InstallMSI + "installmsi": InstallMSI, + "installapk": InstallApk } # 参数数列表 @@ -533,7 +556,8 @@ class Command(): "installother": [1], "decompressionbottle": [2], "programforum": [0], - "installmsi": [1] + "installmsi": [1], + "installapk": [1] } windowsUnrun = [ "createbotton", @@ -548,7 +572,8 @@ class Command(): "installdxvk", "installfont", "installsparkcorefont", - "decompressionbottle" + "decompressionbottle", + "installapk" ] # 解析 def __init__(self, command: list, wineBottonPath: str, wine: str) -> int: @@ -598,7 +623,11 @@ class Command(): for b in programEnv: if b[0] in i[a]: i[a] = i[a].replace(b[0], b[1]) - commandReturn = self.commandList[i[0]](self) + try: + commandReturn = self.commandList[i[0]](self) + except: + traceback.print_exc() + commandReturn = 1 if commandReturn: print(f"运行命令{' '.join(self.command)}出现错误,返回值:", commandReturn) programEnv[9][1] = str(commandReturn) diff --git a/deb/opt/apps/deepin-wine-runner/Mount.sh b/deb/opt/apps/deepin-wine-runner/Mount.sh index 4ef5f0e..a50e06a 100755 --- a/deb/opt/apps/deepin-wine-runner/Mount.sh +++ b/deb/opt/apps/deepin-wine-runner/Mount.sh @@ -41,6 +41,7 @@ if [[ $2 == "root" ]]; then else mount --bind "/home/$2" "$1/home/$2" fi - +# 挂载此内容以可以跨架构运行程序 +mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc # 如果参数 3 存在 "$programPath/pardus-chroot" "--userspec=$2:$2" . env "HOME=/home/$2" ${@:3} diff --git a/deb/opt/apps/deepin-wine-runner/MountWithoutHome.sh b/deb/opt/apps/deepin-wine-runner/MountWithoutHome.sh index af91d24..9cff35f 100755 --- a/deb/opt/apps/deepin-wine-runner/MountWithoutHome.sh +++ b/deb/opt/apps/deepin-wine-runner/MountWithoutHome.sh @@ -26,6 +26,7 @@ cp -r /usr/bin/qemu-*-static ./usr/bin #mount --bind /dev/shm ./dev/shm chmod 777 -R root tmp xhost + - +# 挂载此内容以可以跨架构运行程序 +mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc # 如果参数 3 存在 "$programPath/pardus-chroot" . ${@:3} diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index 373624c..655345f 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -281,6 +281,30 @@ class Runexebutton_threading(QtCore.QThread): else: option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message " wineUsingOption = "" + exePath = e2.currentText() + if True: + fileName = [".exe"] + changePath = False + for i in fileName: + if i in exePath: + print(i) + print(exePath) + l = exePath.index(i) + exePath = f"{exePath[:l+4]}' {exePath[l+4:]} '" + print(l) + print(exePath) + changePath = True + break + #if not changePath and not os.path.exists(changePath): + if not changePath and not os.path.exists(exePath): + # 删除前后无用空格以防止出现问题 + print(exePath) + exePath = exePath.strip() + l = exePath.index(" ") + exePath = f"{exePath[:l]}' {exePath[l:]} '" + print(l) + #print(i) + print(exePath) if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable": wineUsingOption = "" if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable": @@ -293,15 +317,19 @@ class Runexebutton_threading(QtCore.QThread): res = "" if e2.currentText()[-4:] == ".msi" and os.path.exists(e2.currentText()): OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " msiexec /i '" + e2.currentText() + "' " + setting["WineOption"]) + elif e2.currentText()[-4:] == ".bat" and os.path.exists(e2.currentText()): + OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " wineconsole '" + e2.currentText() + "' " + setting["WineOption"]) else: - OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]) + OpenTerminal("env WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + exePath + "' " + setting["WineOption"]) #res = subprocess.Popen([f"'{programPath}/launch.sh' deepin-terminal -C \"WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"] + "\" --keep-open" + wineUsingOption], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: if e2.currentText()[-4:] == ".msi" and os.path.exists(e2.currentText()): res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " msiexec /i '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + elif e2.currentText()[-4:] == ".bat" and os.path.exists(e2.currentText()): + res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " wineconsole '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: - print(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]]) - res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + e2.currentText() + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + print(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + exePath + "' " + setting["WineOption"]]) + res = subprocess.Popen(["WINEPREFIX='" + wineBottonPath + "' " + option + wine[o1.currentText()] + " '" + exePath + "' " + setting["WineOption"]], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) # 实时读取程序返回 # if not setting["TerminalOpen"]: @@ -2114,7 +2142,7 @@ defultProgramList = { "WineBottonDifferent": False, "CenterWindow": False, "Theme": "", - "MonoGeckoInstaller": True, + "MonoGeckoInstaller": False, "AutoWine": True, "RuntimeCache": True, "MustRead": False, @@ -2214,6 +2242,10 @@ 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 + if not os.path.exists(get_home() + "/.config/deepin-wine-runner/mono-lock"): + os.mknod(f"{get_home()}/.config/deepin-wine-runner/mono-lock") + setting["MonoGeckoInstaller"] = False + change = True for i in defultProgramList.keys(): if not i in setting: change = True @@ -2561,7 +2593,7 @@ mainLayout.setColumnStretch(1, 1) mainLayout.addWidget(returnText, 0, 1, 2, 1) # 版权 -copy = QtWidgets.QLabel(f"""\n程序版本:{version},提示:Wine 无法运行所有的 Windows 程序,如果想要运行更多可执行程序,可以考虑虚拟机和双系统
+copy = QtWidgets.QLabel(f"""\n程序版本:{version},提示:Wine 无法运行保证可以运行所有的 Windows 程序,如果想要运行更多可执行程序,可以考虑虚拟机和双系统
©2020~{time.strftime("%Y")} gfdgd xi、为什么您不喜欢熊出没和阿布呢,RacoonGX 团队作品""") mainLayout.addWidget(copy, 2, 0, 1, 1) @@ -2590,12 +2622,12 @@ installWineOnDeepin23Alpha = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/ installWineHQ = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/wine.png"), transla.transe("U", "安装 WineHQ")) installMoreWine = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/more-wine.png"), transla.transe("U", "安装更多 Wine")) downloadChrootBottle = QtWidgets.QAction(QtGui.QIcon(f"{programPath}/Icon/Function/CHROOT.png"), transla.transe("U", "下载 Chroot 容器")) -p2 = QtWidgets.QAction(transla.transe("U", "设置程序(&S)")) +p2 = QtWidgets.QAction(QtGui.QIcon.fromTheme("settings"), transla.transe("U", "设置程序(&S)")) enabledAll = QtWidgets.QAction(transla.transe("U", "强制启用所有被禁用的组件(不推荐)")) p3 = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "清空软件历史记录(&C)")) cleanCache = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "清空软件缓存")) cleanProgramUnuse = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(47), transla.transe("U", "删除程序组件")) -p4 = QtWidgets.QAction(transla.transe("U", "退出程序(&E)")) +p4 = QtWidgets.QAction(QtGui.QIcon.fromTheme("exit"), transla.transe("U", "退出程序(&E)")) programmenu.addAction(p1) programmenu.addAction(installWineOnDeepin23) programmenu.addAction(installWineOnDeepin23Alpha) diff --git a/deb/opt/apps/deepin-wine-runner/getxmlimg.py b/deb/opt/apps/deepin-wine-runner/getxmlimg.py new file mode 100755 index 0000000..af59a70 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/getxmlimg.py @@ -0,0 +1,118 @@ +import PIL.Image as Image +import PIL.ImageDraw as ImageDraw +import zipfile +import subprocess +import re + +class getsavexml(): + + def savexml(self,apkFilePath,xmlpath,iconSavePath): + cmddumpid = "aapt dump xmltree "+ apkFilePath + " " + xmlpath + print(cmddumpid) + xmltree = subprocess.getoutput(cmddumpid) + xmls = xmltree.splitlines() + # find strs ,print next line + def FindStrs(lines,strs): + i=0 + while i < len(lines): + if re.search(strs,lines[i]): + tmpstr = lines[i+1] + i += 1 + Resultstr = tmpstr.split(":")[-1].split("=")[-1].split("0x")[-1] + return Resultstr + else: + i += 1 + #从apk的信息中获取前后景图片的ID号 + backimgid = FindStrs(xmls,"background") + foreimgid = FindStrs(xmls,"foreground") + print(backimgid) + print(foreimgid) + + # 直接从apk resource文件获取前后两层图片路径及ID字符串 + resource = subprocess.getoutput("aapt dump --values resources " + apkFilePath + "| grep -iE -A1 " + "\"" + backimgid + "|" + foreimgid + "\"") + resourcelines = resource.splitlines() + print(resourcelines) + + # 从过滤出的字符串中获取所有相同ID的图片路径 + def Findpicpath(lines,imgid): + i=0 + Resultstr = [] + while i < len(lines): + if re.search(imgid,lines[i]) and re.search("string8",lines[i+1]) : + print(lines[i+1]) + tmpstr = lines[i+1].replace("\"","") + i += 1 + Resultstr.append(tmpstr.split()[-1]) + else: + i += 1 + return Resultstr + + #获取所有带前后图片ID的图片路径(相同背景或者前景的图片ID但分辨率不一样) + backimgs = Findpicpath(resourcelines,backimgid) + foreimgs = Findpicpath(resourcelines,foreimgid) + print(backimgs) + print(foreimgs) + #获取分辨率最高的图片路径 + def getmaxsize(imgs): + j = 0 + size=(0,0) + zipapk = zipfile.ZipFile(apkFilePath) + imgpath = "" + while j < len(imgs): + print(imgs[j]) + img = Image.open(zipapk.open(imgs[j])) + print(imgs[j]) + print(img.size) + if size < img.size: + size = img.size + imgpath = imgs[j] + j += 1 + return imgpath + + # 获取到文件列表后,进行比较分辨率,选取分辨率最高的张图片 + iconbackpath = getmaxsize(backimgs) + iconforepath = getmaxsize(foreimgs) + print(iconbackpath + " " + iconforepath) + + #从APK文件获取最终图片 + zipapk = zipfile.ZipFile(apkFilePath) + iconback = zipapk.open(iconbackpath) + iconfore = zipapk.open(iconforepath) + + + # 叠加图片,mask 设置前景为蒙版 + iconbackimg = Image.open(iconback).convert("RGBA") + iconforeimg = Image.open(iconfore).convert("RGBA") + iconbackimg.paste(iconforeimg,mask=iconforeimg) + + + # 圆角图片函数,网上拷贝的 + def circle_corner(img, radii): #把原图片变成圆角,这个函数是从网上找的,原址 https://www.pyget.cn/p/185266 + """ + 圆角处理 + :param img: 源图象。 + :param radii: 半径,如:30。 + :return: 返回一个圆角处理后的图象。 + """ + # 画圆(用于分离4个角) + circle = Image.new('L', (radii * 2, radii * 2), 0) # 创建一个黑色背景的画布 + draw = ImageDraw.Draw(circle) + draw.ellipse((0, 0, radii * 2, radii * 2), fill=255) # 画白色圆形 + # 原图 + img = img.convert("RGBA") + w, h = img.size + # 画4个角(将整圆分离为4个部分) + alpha = Image.new('L', img.size, 255) + alpha.paste(circle.crop((0, 0, radii, radii)), (0, 0)) # 左上角 + alpha.paste(circle.crop((radii, 0, radii * 2, radii)), (w - radii, 0)) # 右上角 + alpha.paste(circle.crop((radii, radii, radii * 2, radii * 2)), (w - radii, h - radii)) # 右下角 + alpha.paste(circle.crop((0, radii, radii, radii * 2)), (0, h - radii)) # 左下角 + # alpha.show() + img.putalpha(alpha) # 白色区域透明可见,黑色区域不可见 + return img + + # 圆角半径1/8边长,保存icon图片 + w,h = iconbackimg.size + iconimg = circle_corner(iconbackimg,int(w/8)) + iconimg.save(iconSavePath) + diff --git a/deb/opt/apps/deepin-wine-runner/information.json b/deb/opt/apps/deepin-wine-runner/information.json index 70d96dc..127cbfb 100755 --- a/deb/opt/apps/deepin-wine-runner/information.json +++ b/deb/opt/apps/deepin-wine-runner/information.json @@ -1,8 +1,9 @@ { "Version": "3.1.0", "Thank": [ + "感谢 @Amber 编写的《使用wine运行器打包无安装包的软件》:https://bbs.deepin.org/post/247720", "感谢 @豪 提供程序图标", - "感谢 @鹤舞白沙 对程序文案进行优化以及编写《Wine运行器和Wine打包器傻瓜式使用教程(小白专用) 》", + "感谢 @鹤舞白沙 对程序文案进行优化以及编写《Wine运行器和Wine打包器傻瓜式使用教程(小白专用) 》:https://bbs.deepin.org/post/246837", "感谢 @璀璨星空 提供的彩蛋图标", "感谢 @Bail 反馈的更新策略问题", "感谢 @白水 反馈的安装 exagear 后无法识别和调用 box86 的问题", diff --git a/deb/opt/apps/deepin-wine-runner/package-script.zip b/deb/opt/apps/deepin-wine-runner/package-script.zip index 7c1f09c723c01bd919a53da0ee4ad2705ea4d15d..18b4ee0ed949aa1888d40c15ad6e99607132e1c0 100755 GIT binary patch delta 1713 zcmZ{jYe*DP6vyX!PpMCRu*aKA8(WG|NCmx12dFk-Cb*#@Aa|pQFht6-fU9)69tmv)i4$0ql{Qj>8QJ|_vYC?Z<$&4@=GSs z`$~F~J!!68jD1V)7vf+t*aDuGS3Iv~SU&OhXhyToat*%osq&Z18S!hdhiI1GaLZvn zl%!h0i}&WRas`WXS~#`$Ow;al8~gSlN?#iE&;UQP9NNBf=v!R~#}!0zT!a`p!*a(j zR4sk`h2QlM>Mf64rqYvLkwRA_x<#)_3f*YYB>l=Z^3aVmpYYd>ZuwGvcL>G(*W^Ep zlGI{C#xM%W}3X8ntAOH!o=~0Sq2Qjq`-)SR3WJ`;uX~Y*ob3PEc`a&x!54BCo3{#VZXSW zV^hd8Hwq%1IoOkYaR5J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>R6IEP%!j7dAb~rA|;w;bjwT9NxAY-$M~V63@k==NZTeoErX%Jd2a-H@h>nqCVQ9rD(~QXPt_gJn8YTn9^J zM2izEy{`ig<|R6LMkx_H09JI;bB3nXx3()iFjME)?ol2rCoiwf@Ut|Et_|xzB5|CB zR(?lXJuJ{JC-wEv!TF{Jn4xp+YWS=0iQYdiV(Uzfd10|m_}vQ&b;#BT({<=tqhc>- zE06t1A56n^?D-_IVJG{1FrSS!%OjQ#=u00>fetQ@k_X+=1S@suP801I9b*!44o3Y3 Du;RDk diff --git a/deb/opt/apps/deepin-wine-runner/wine/installwine b/deb/opt/apps/deepin-wine-runner/wine/installwine index 048fab1..82f8bd0 100755 --- a/deb/opt/apps/deepin-wine-runner/wine/installwine +++ b/deb/opt/apps/deepin-wine-runner/wine/installwine @@ -227,7 +227,7 @@ class DownloadThread(QtCore.QThread): #progressbar.update(int(part / show)) filePart.write(chunk) bytesRead += 1024 - self.ChangeDialog.emit(self.dialog, bytesRead / allSize * 100, bytesRead / 1024 / 1024, allSize / 1024 / 1024) + self.ChangeDialog.emit(self.dialog, int(bytesRead / allSize * 100), int(bytesRead / 1024 / 1024), int(allSize / 1024 / 1024)) # 写入配置文件 rfile = open(f"{programPath}/winelist.json", "r") list = json.loads(rfile.read()) diff --git a/package-script.zip b/package-script.zip index 7c1f09c723c01bd919a53da0ee4ad2705ea4d15d..18b4ee0ed949aa1888d40c15ad6e99607132e1c0 100755 GIT binary patch delta 1713 zcmZ{jYe*DP6vyX!PpMCRu*aKA8(WG|NCmx12dFk-Cb*#@Aa|pQFht6-fU9)69tmv)i4$0ql{Qj>8QJ|_vYC?Z<$&4@=GSs z`$~F~J!!68jD1V)7vf+t*aDuGS3Iv~SU&OhXhyToat*%osq&Z18S!hdhiI1GaLZvn zl%!h0i}&WRas`WXS~#`$Ow;al8~gSlN?#iE&;UQP9NNBf=v!R~#}!0zT!a`p!*a(j zR4sk`h2QlM>Mf64rqYvLkwRA_x<#)_3f*YYB>l=Z^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