From a90fb2ae37b0f6cfbe6ede3788bdd65388456db7 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sun, 20 Nov 2022 17:48:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=AB=E6=8D=B7=E6=96=B9=E5=BC=8F=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BuildDesktop.py | 122 ++++++++++++++++++ CheckDLL/CheckCommand.py | 9 +- CheckDLL/bash/mfc100.dll.sh | 9 ++ CheckDLL/bash/mfc42.dll.sh | 7 + CheckDLL/bash/msvbvm60.dll.sh | 9 ++ .../InstallVisualBasicRuntime.cpython-37.pyc | Bin 3527 -> 3624 bytes .../InstallVisualCPlusPlus.cpython-37.pyc | Bin 4752 -> 4828 bytes deb/DEBIAN/.postinst.swp | Bin 0 -> 12288 bytes deb/DEBIAN/control | 2 +- deb/DEBIAN/postinst | 8 +- .../CheckDLL/CheckCommand.py | 9 +- .../CheckDLL/bash/mfc100.dll.sh | 9 ++ .../CheckDLL/bash/mfc42.dll.sh | 7 + .../CheckDLL/bash/msvbvm60.dll.sh | 9 ++ .../deepin-wine-runner/deepin-wine-runner | 97 +++++++++++++- .../deepin-wine-runner/package-script.zip | Bin 301376 -> 301376 bytes demo/CheckDLL/main.py | 9 +- mainwindow.py | 97 +++++++++++++- package-script.zip | Bin 301376 -> 301376 bytes 19 files changed, 387 insertions(+), 16 deletions(-) create mode 100755 BuildDesktop.py create mode 100644 CheckDLL/bash/mfc100.dll.sh create mode 100644 CheckDLL/bash/msvbvm60.dll.sh mode change 100755 => 100644 __pycache__/InstallVisualBasicRuntime.cpython-37.pyc mode change 100755 => 100644 __pycache__/InstallVisualCPlusPlus.cpython-37.pyc create mode 100644 deb/DEBIAN/.postinst.swp create mode 100644 deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc100.dll.sh create mode 100644 deb/opt/apps/deepin-wine-runner/CheckDLL/bash/msvbvm60.dll.sh diff --git a/BuildDesktop.py b/BuildDesktop.py new file mode 100755 index 0000000..ec766ca --- /dev/null +++ b/BuildDesktop.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python3 +# 使用系统默认的 python3 运行 +################################################################################################################# +# 作者:gfdgd xi +# 版本:2.5.0 +# 更新时间:2022年11月20日 +# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序 +# 基于 Python3 的 PyQt5 构建 +################################################################################################################# +################# +# 引入所需的库 +################# +import os +import sys +import traceback +import PyQt5.QtGui as QtGui +import PyQt5.QtCore as QtCore +import PyQt5.QtWidgets as QtWidgets + +desktopList = [] +desktopUsrList = [] + +def GetDesktopList(path): + for i in os.listdir(path): + if os.path.isdir(f"{path}/{i}"): + GetDesktopList(f"{path}/{i}") + if os.path.isfile(f"{path}/{i}"): + try: + desktop = {} + with open(f"{path}/{i}") as file: + things = file.read() + for k in things.splitlines(): + if not "=" in k: + continue + desktop[k[:k.index("=")].lower()] = k[k.index("=") + 1:] + desktopList.append([desktop["Name".lower()], desktop["Icon".lower()], desktop["Exec".lower()], f"{path}/{i}"]) + except: + traceback.print_exc() + delButton.setEnabled(len(desktopList)) + +class DesktopList(QtCore.QThread): + show = QtCore.pyqtSignal(int) + def __init__(self) -> None: + super().__init__() + + def run(self): + if os.path.exists(f"{homePath}/.local/share/applications"): + GetDesktopList(f"{homePath}/.local/share/applications") + self.show.emit(0) + +def ShowDesktop(temp): + nmodel = QtGui.QStandardItemModel(window) + if not len(desktopList): + item = QtGui.QStandardItem("无") + nmodel.appendRow(item) + y = 0 + for i in desktopList: + #item = QtGui.QStandardItem(QtGui.QIcon(i[1]), i[0]) + #nmodel.appendRow(item) + if os.path.exists(i[1]): + nmodel.setItem(y, 0, QtGui.QStandardItem(QtGui.QIcon(i[1]), i[0])) + else: + nmodel.setItem(y, 0, QtGui.QStandardItem(QtGui.QIcon.fromTheme(i[1]), i[0])) + nmodel.setItem(y, 1, QtGui.QStandardItem(i[2])) + nmodel.setItem(y, 2, QtGui.QStandardItem(i[3])) + y += 1 + nmodel.setHeaderData(0, QtCore.Qt.Horizontal, "程序名") + nmodel.setHeaderData(1, QtCore.Qt.Horizontal, "运行路径") + nmodel.setHeaderData(2, QtCore.Qt.Horizontal, ".desktop 文件所在路径") + nmodel.setColumnCount(3) + desktopListView.setModel(nmodel) + +def GetDesktopThread(): + global desktop + desktop = DesktopList() + desktop.show.connect(ShowDesktop) + desktop.start() + +def DeleteButton(): + index = desktopListView.currentIndex().row() + if index < 0: + QtWidgets.QMessageBox.critical(window, "错误", "未选中任何项") + return + print(index) + print(desktopList[index][3]) + #desktopListView.rowMoved(index) + + #desktopListView.removeRow(index) + try: + os.remove(desktopList[index][3]) + del desktopList[index] + ShowDesktop(0) + except: + traceback.print_exc() + QtWidgets.QMessageBox.critical(window, "错误", traceback.format_exc()) + + +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +homePath = os.getenv("HOME") +iconPath = "{}/deepin-wine-runner.svg".format(programPath) +#GetDesktopList(f"{homePath}/.local/share/applications") +#print(desktopList) +app = QtWidgets.QApplication(sys.argv) +window = QtWidgets.QMainWindow() +widget = QtWidgets.QWidget() +layout = QtWidgets.QGridLayout() +delButton = QtWidgets.QPushButton("删除指定图标") +delButton.clicked.connect(DeleteButton) +#desktopListView = QtWidgets.QListView() +desktopListView = QtWidgets.QTableView() +desktopListView.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) +desktopListView.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)#(QAbstractItemView::SelectRows) +layout.addWidget(desktopListView, 0, 0, 1, 4) +layout.addWidget(delButton, 1, 3, 1, 1) +widget.setLayout(layout) +window.setCentralWidget(widget) +window.setWindowTitle("图标管理") +window.resize(int(window.frameGeometry().width() * 1.5), int(window.frameGeometry().height() * 1.2)) +window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) +window.show() +GetDesktopThread() +app.exec_() \ No newline at end of file diff --git a/CheckDLL/CheckCommand.py b/CheckDLL/CheckCommand.py index 8714c86..ec40028 100755 --- a/CheckDLL/CheckCommand.py +++ b/CheckDLL/CheckCommand.py @@ -40,6 +40,9 @@ if "-w" in sys.argv: wineProgram = sys.argv[wineCommand + 2] except: pass +badChar = [ + "(", "?", "*", "!", ")", "&", "'", "\"" +] with open(sys.argv[1], "rb") as file: while True: things = file.readline() @@ -49,7 +52,11 @@ with open(sys.argv[1], "rb") as file: if n.encode() in things: # 提取 DLL 名称 for i in str(things[1: -2]).split("\\x"): - if n in i and not "(" in i and i[0] != "/": + charBad = False + for b in badChar: + if b in i: + charBad = True + if n in i and not charBad and i[0] != "/": name = i[2: ].replace(",{M", "").replace("+", "") # 文件路径合法性检测 diff --git a/CheckDLL/bash/mfc100.dll.sh b/CheckDLL/bash/mfc100.dll.sh new file mode 100644 index 0000000..4e6dd81 --- /dev/null +++ b/CheckDLL/bash/mfc100.dll.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月19日 +########################################################################################## +# 用于判断是否为 bash 解释器 +installvcpp 4 +info 提示 修复完成!重新检测即可 \ No newline at end of file diff --git a/CheckDLL/bash/mfc42.dll.sh b/CheckDLL/bash/mfc42.dll.sh index 82c3ab0..3accf08 100644 --- a/CheckDLL/bash/mfc42.dll.sh +++ b/CheckDLL/bash/mfc42.dll.sh @@ -1,2 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月03日 +########################################################################################## +# 用于判断是否为 bash 解释器 installother 2 info 提示 修复完成!重新检测即可 diff --git a/CheckDLL/bash/msvbvm60.dll.sh b/CheckDLL/bash/msvbvm60.dll.sh new file mode 100644 index 0000000..fa2f944 --- /dev/null +++ b/CheckDLL/bash/msvbvm60.dll.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月19日 +########################################################################################## +# 用于判断是否为 bash 解释器 +installvb 4 +info 提示 修复完成!重新检测即可 \ No newline at end of file diff --git a/__pycache__/InstallVisualBasicRuntime.cpython-37.pyc b/__pycache__/InstallVisualBasicRuntime.cpython-37.pyc old mode 100755 new mode 100644 index 727d9e22ad093947a6bd67a98504ce5abe18c4fa..a8ec0819102dfcc2771adf56291a47b8623ad053 GIT binary patch delta 971 zcmbVL%}*0i5P$D&KY_N;mbOc)pr90`ts*LV&}fV&V@NO}8#OVVap?zJ*=gDX% zZZso=vYVgoLp)+Qgv0WN#2X(ZVf?jE8^H*qYGOy2KOv308m$G)&lu}K#^#)1 z3{=lfxR!TEd(;}oWU9>}TjSPu`3^ai!HJsiyzIc+;bxpLPI?%Vo}KdSsXs7THQr6Y zX&N$#ofu4eNi)*67jPV8+px`Tafdyb(oz`1)E>6N6JMF)f%S)Ky}c%M$jfK z%LcGYs~+G1j@nX{7|anF^_YxsN04((V3Mew^Hxb6NwvpG_J>q;evsGA!n~(thZ3OR zI&Lx){|124ez+$$DGe7~fFlwYkKq>nS><=D7`40Pt}jX|gd-!D-N=>B?@ZyU=g}S$ zt)>0oarzP8|DX$eh0R_2CO`iBFCVNon=h>ErBb;8Skx=dP33NWQ3ffdKL;J!mEwkF zSjDnY+Nu~>Fk6O!W}#lOn*A;1li+PRN~6F0RGJz8irEp6Cpw9GPE_o$2WcBG#$ RDL=#qrx1b%MACss`4{rfgc5ZzfjiIXNy+BB(?6bNl8DU<@`D;F-PKOllbz*2LdvkHo(pxPi32`LBj z15)`|BH0(j5tIuOCk}`Ue}LYQ_z_4T!L02@s^|r;>{;)=nfK;-{dW0FO~04RWf)zX z_wVk#FC6Fw|IH5?tD~~uenO~z5_tf^IwN&>60Y zGG1`OUkaFM2m{xtQ?LguMm|tura^8Rk(iQGc!->`rZI>LykEh=qyT9TmC zX0w7{Mc$RJ=-41J#!L*C1%>RZB8nt+Bi q{6&rwXXqTMJ?ClPRBW+tYV>$6oM(>rCp*pe38FzXIF!B5xxK%ISj&?D diff --git a/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc b/__pycache__/InstallVisualCPlusPlus.cpython-37.pyc old mode 100755 new mode 100644 index 5dc520b8dec8aa94464f72d57ed31c7c1c73b169..02e9f8d54ce9847d92665f639c227793f87a5551 GIT binary patch delta 956 zcma)5O-~a+7@nDJ3oW#zP)e5%K?N%!6!8N^R0RA+L!t?~Mor`yR$5$T7o>Qpas2@$ zy_hITd+EtrPu~0?-uww(J^0RUAsRWjlig=#-sgGWXWq${hQ1HQW~0#vqo@9JZTWd> zCzj^(JDI^^F9bAG7(pp2AsMJNRavgN%8l?6v)*u~1_B700wFY^+0+n51TBQEh@5Me(CaG3B2j$*J#lOY^K#?;KH5q`uh@sP=g zY*8RvE=eUX(O@1}7!Y#quHhmyBc7<(v_YH8ATTue4RkxJ)Rf%Q2qk zCGL1SoYEO4D3iY~#xTCOVLzZmryGgRH1KQ#&;6B{<=QJ9n4~@>NprrzxuCExAv>W; zhh6T9dG=($NXfWNePWoBVVR<8OlP0iuBO<<5?_C}#0pQh2W1y7y1bIEGDDX-rjf$)YTd7n$-Q$d5YS#Mf$GSmMH4w6LwOzxvDd9 zTqZNRUfgpdyfdhCb;~4qz2b$L>W=bS2nYdouPj}-$S9zk-`3sTrhWFoc1PI% z_yxbuhVPYg+Oy%elP@+lUQcDS<_b&{R>xjCmNT|&Ww%x>IcjfOmb6FLR-KLdSM5uP z7s@MLLuorMd@K(01**}GWqb}!+@K}tqA#y(#kZ>_1BVCTUHt+CPQ_{lmD#Hn4 z>f3WKW5!|})>XnY$a7Ui zk+d$xZfcLz8t{%{f1J(gh-(p>Lv+{w znU)OG82N96{+m(?5y_of;m+;fh2l*7uxuuU_y6Z04T#GV!dZ ztGgP1>wQUYsdO_~Z!ELS`DE|;U@6H*y^Z|1_c`AyzN0Iq^Jpo&!Zk(n)(b`Nec|yh DPzBO~ diff --git a/deb/DEBIAN/.postinst.swp b/deb/DEBIAN/.postinst.swp new file mode 100644 index 0000000000000000000000000000000000000000..3018621a547de5cdd7b45f03c5760a2ae6dcc4c5 GIT binary patch literal 12288 zcmeI2U2GIp6vr>dh^Q#R7awoi=!0fwwo_>92Pja8L_x$*NQ{B)?zB5$J2TElX^qjA zey}ZtE~e0KTUw}vR)sB*rnbBNc=6RYjEN6E=-fNACZ=yZd+zMEfT2s_L8IPD{+;Q} z{W$k`&OJ9xPff6T?><~9NC>V?2yIO@ga=@@vRW{&7jaapN=iVLrMO`y3MK!I$WAd+@04J~p z0=88fsN9Ikq|zX3T~b_xpWl3F4IOzCPJk2O1ULasfD_;ZH~~(86Zo$Xu=I84b6Ct{ z`31e4zpwktJ^w4eaRQtGC%_4C0-OLRzzJ{yoB$`l32*|Oz`u|{C;~=5fzbCL_W%Fo zzyEJPhtMrh4X6mT3G~Oa2ps{v3;KB@Lc^eLQ1%&wegd_FWY8<1&7fbOMraDu4SEZ7 z`zh!Lx(aFpy#smy^vec>u7f@Sy#ZPey7eSNgP?wp2HFVveLX^>phl1cVmAN4?B*9I zzzJ{yoWTE*K-e~7IBHqC`I;z}1-Fz-<@&2qg;1wOH6g5trXDhm2Ux9{qTW+&win9F zLa~^jNA)+WWy4f7b(WLF{iRa;DYgt-MkSae&e5SWr0X(C zPI!yGWN?_II=wI3>G>O^>r&~`T-=#CL;Dxpu{7yuC#hLyrk5>AL9`#NBHo%;%*R-1(F{m?HD%>BZJ;GO;w*?WMkQdnai8 zJJK`hO=jRH=}5wRdSTXCSR{$FZst0PU&S@Nn&gC>FFauW_k z8gPI;nX=I!8+heOuxo79vH@y6G%)0FgWn48sVd*Sdq?RWDY&a@%TB3c)foU@{08lt zCe29_KSj@s;yS$!({#d_8^~L}5GP{;s8&H644A~IEl5YqyKujJ;xLpEzWu&nM%UJH zM=ZAD{-(8c@#Dy}G(#3*3KS+jjDgI$_tYvs2Bk7VziUd{G{hQ3y^rtxV2yqpU}caH zr*|fNK$l1Ekl!Ry*+Wky8)!pG-eJXs;#p+np2g4@dy7eD=4*O$B73Tfp6zr8+T28k zmr6q@Lu5lJ!!B~iGZ4Wm);xG*oM+|Fkc1AkgII7|7#o;5B<#c$O4!41i@`xvA?|x7FE`bM`LvyJ|sl^}S zV<96PJ%)?6;o`>1@}uQjit$IUV=F4FETvvONr#7=nKTT8VSIdG7aP21(#c%OO#u<& z%rrac!TjL<$bPELcvo9!KZ_X%7$@Dq(yMPO?Hux@uD#(I;g+ZMclEN@zJBoKuHLkXu85{mug6wTzrNAAXw8EwVYta$n#8AR^Edz{i|r)coBPU=eP=TOg5`mW*qP%$ zWLxK9*{J02zL*rk;eeFbICUPY>vyJIvW;hGf+s$FQ48lCg1;ns(+Fb9n=fMjAf{`<%24()8QQG_flgJJKz?`xd}fuiu@A?{PZWCmn#VX literal 0 HcmV?d00001 diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control index d191ee7..99a144b 100755 --- a/deb/DEBIAN/control +++ b/deb/DEBIAN/control @@ -1,5 +1,5 @@ Package: spark-deepin-wine-runner -Version: 2.5.0~alpha1 +Version: 2.5.0~alpha2 Maintainer: gfdgd xi <3025613752@qq.com>, 为什么您不喜欢熊出没和阿布呢 Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner, https://github.com/gfdgd-xi/deep-wine-runner, https://gitlink.org.cn/gfdgd_xi/deep-wine-runner Architecture: all diff --git a/deb/DEBIAN/postinst b/deb/DEBIAN/postinst index 513ceaa..938fa23 100755 --- a/deb/DEBIAN/postinst +++ b/deb/DEBIAN/postinst @@ -9,7 +9,7 @@ ################################################################################################################# # 非强制性的必应组件,所以成功不成功都行 echo 安装组件 -python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null | true +python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true echo 执行完成 # 如果为非 X86 PC,可以删除掉一些无用组件(主要是用不了) if [ `arch` != "x86_64" ]; then @@ -34,9 +34,9 @@ if [ `arch` != "x86_64" ]; then rm -rf /opt/apps/deepin-wine-runner/InstallNewWineHQ.sh fi # 到时候切换 gpg 源会方便很多 -apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FD6EEA1F20CD4B27 > /dev/null -apt update > /dev/null | true +apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FD6EEA1F20CD4B27 > /dev/null 2>&1 | true +apt update > /dev/null 2>&1 | true # 设置目录权限,让用户可读可写,方便后续删除组件 chmod 777 -R /opt/apps/deepin-wine-runner # 向服务器返回安装数加1(不显示内容且忽略错误) -curl https://304626p927.goho.co/spark-deepin-wine-runner/Install.php?Version=2.5.0 -s > /dev/null | true +curl https://304626p927.goho.co/spark-deepin-wine-runner/Install.php?Version=2.5.0 -s > /dev/null 2>&1 | true diff --git a/deb/opt/apps/deepin-wine-runner/CheckDLL/CheckCommand.py b/deb/opt/apps/deepin-wine-runner/CheckDLL/CheckCommand.py index 8714c86..ec40028 100755 --- a/deb/opt/apps/deepin-wine-runner/CheckDLL/CheckCommand.py +++ b/deb/opt/apps/deepin-wine-runner/CheckDLL/CheckCommand.py @@ -40,6 +40,9 @@ if "-w" in sys.argv: wineProgram = sys.argv[wineCommand + 2] except: pass +badChar = [ + "(", "?", "*", "!", ")", "&", "'", "\"" +] with open(sys.argv[1], "rb") as file: while True: things = file.readline() @@ -49,7 +52,11 @@ with open(sys.argv[1], "rb") as file: if n.encode() in things: # 提取 DLL 名称 for i in str(things[1: -2]).split("\\x"): - if n in i and not "(" in i and i[0] != "/": + charBad = False + for b in badChar: + if b in i: + charBad = True + if n in i and not charBad and i[0] != "/": name = i[2: ].replace(",{M", "").replace("+", "") # 文件路径合法性检测 diff --git a/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc100.dll.sh b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc100.dll.sh new file mode 100644 index 0000000..4e6dd81 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc100.dll.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月19日 +########################################################################################## +# 用于判断是否为 bash 解释器 +installvcpp 4 +info 提示 修复完成!重新检测即可 \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc42.dll.sh b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc42.dll.sh index 82c3ab0..3accf08 100644 --- a/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc42.dll.sh +++ b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/mfc42.dll.sh @@ -1,2 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月03日 +########################################################################################## +# 用于判断是否为 bash 解释器 installother 2 info 提示 修复完成!重新检测即可 diff --git a/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/msvbvm60.dll.sh b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/msvbvm60.dll.sh new file mode 100644 index 0000000..fa2f944 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/CheckDLL/bash/msvbvm60.dll.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env deepin-wine-runner-auto-install-bash +# 使用 Wine 运行器的语言解析器 +########################################################################################## +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 更新时间:2022年11月19日 +########################################################################################## +# 用于判断是否为 bash 解释器 +installvb 4 +info 提示 修复完成!重新检测即可 \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index d8e93dd..3d10555 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -95,7 +95,7 @@ def liulanbutton(): # 第二个浏览按钮事件 def liulanexebutton(): - path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 exe 可执行文件", json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/FindExe.json"))["path"], "exe 可执行文件(*.exe);;EXE 可执行文件(*.EXE);;所有文件(*.*)") + path = QtWidgets.QFileDialog.getOpenFileName(widget, "选择 exe 可执行文件", json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/FindExe.json"))["path"], "exe 可执行文件(*.exe);;MSI 文件(*.msi);;所有文件(*.*)") if path != "" and path != "()": e2.setEditText(path[0]) # 显示路径 write_txt(get_home() + "/.config/deepin-wine-runner/FindExe.json", json.dumps({"path": os.path.dirname(path[0])})) # 写入配置文件 @@ -132,7 +132,87 @@ class QT: e1.addItems(findExeHistory) e1.setEditText(findExeHistory[-1]) +repairList = [] # Flag: 日志推断解决方案功能 +class LogChecking(): + def ShowWindow(): + global logThread + global logWindow + global questionList + global repairButton + logWindow = QtWidgets.QWidget() + logWindowLayout = QtWidgets.QGridLayout() + questionList = QtWidgets.QListView() + repairButton = QtWidgets.QPushButton("一键修复") + repairButton.setDisabled(True) + repairButton.clicked.connect(LogChecking.RepairButton) + nmodel = QtGui.QStandardItemModel(window) + item = QtGui.QStandardItem("正在分析中……") + questionList.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) + nmodel.appendRow(item) + questionList.setModel(nmodel) + logWindowLayout.addWidget(questionList, 0, 0, 3, 1) + logWindowLayout.addWidget(repairButton, 0, 2, 1, 1) + logWindow.setWindowTitle("分析日志") + logWindow.setLayout(logWindowLayout) + logThread = LogThreading() + logThread.done.connect(LogChecking.Show) + logThread.start() + logWindow.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg")) + logWindow.resize(int(logWindow.frameGeometry().width() * 1.2), int(logWindow.frameGeometry().height() * 1.2)) + logWindow.show() + + def RepairButton(): + index = questionList.currentIndex().row() + lists = questionMap[index] + print(f"{programPath}/CheckDLL/bash/{lists[1].lower()}.sh") + if os.path.exists(f"{programPath}/CheckDLL/bash/{lists[1].lower()}.sh"): + OpenTerminal(f"'{programPath}/AutoShell/main.py' '{programPath}/CheckDLL/bash/{lists[1].lower()}.sh'") + return + QtWidgets.QMessageBox.critical(logWindow, "错误", "无法修复该问题") + + def Show(lists): + global questionMap + nmodel = QtGui.QStandardItemModel(window) + disbledButton = False + print(lists) + if not len(lists): + nmodel.appendRow(QtGui.QStandardItem(f"无法分析到错误")) + disbledButton = True + for i in lists: + if i[0] == 0: + nmodel.appendRow(QtGui.QStandardItem(f"无法分析到错误")) + disbledButton = True + break + if i[0] == 1: + nmodel.appendRow(QtGui.QStandardItem(f"无法调用 Dll:{i[1]}")) + questionMap = lists[:] + repairButton.setDisabled(disbledButton) + questionList.setModel(nmodel) + +class LogThreading(QtCore.QThread): + done = QtCore.pyqtSignal(list) + def __init__(self): + super().__init__() + + def run(self): + global logText + repairList = [] + logText = returnText.toPlainText() + print(logText.splitlines()) + for i in logText.splitlines(): + print(i) + checkingText = i.lower() + if "err:module:import_dll Library".lower() in checkingText: + # Lose Dll + repairList.append([1, i[i.index("Library") + 8: i.index("(")].strip()]) + continue + if "err:module:fixup_imports_ilonly".lower() in checkingText: + # Lose Dll + repairList.append([1, i[i.index("_ilonly") + 8: i.index("not")].strip()]) + continue + self.done.emit(repairList) + def DisableButton(things): button_r_6.setDisabled(things) @@ -1998,11 +2078,12 @@ updateThingsString = '''※1、容器自动配置脚本 GUI 查看介绍使用 Q ※6、新增了对 Deepin 23 Alpha 优化的 Wine 安装器 ※7、新增 Dll 名称查询功能,可以查询对应 Dll 的作用 ※8、支持静态获取可执行文件可以调用的 Dll 并提供解决方案 -9、修复了不基于生态适配活动脚本打包器在选择 arm 打包架构下容器自动删除脚本取消勾选无用的问题 +※9、支持移除指定的 .desktop 快捷方式 +10、修复了不基于生态适配活动脚本打包器在选择 arm 打包架构下容器自动删除脚本取消勾选无用的问题 ''' for i in information["Thank"]: thankText += f"{i}\n" -updateTime = "2022年11月18日" +updateTime = "2022年11月19日" about = f'''