From 9cc549527d1101fc40bc2b8df3378d4c876779d0 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Mon, 28 Nov 2022 10:40:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E6=A0=87=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IconList.json | 29 +++++++++++++++++++++++++++++ Makefile | 4 ++++ deb/DEBIAN/control | 2 +- deepin-wine-easy-packager.py | 16 +++++++++++++++- mainwindow.py | 29 ++--------------------------- 5 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 IconList.json diff --git a/IconList.json b/IconList.json new file mode 100644 index 0000000..b9e4b94 --- /dev/null +++ b/IconList.json @@ -0,0 +1,29 @@ +[ + [ + ["QQ", "wineBottonPath/drive_c/Program Files/Tencent/QQ/Bin/QQ.exe"], + ["QQ", "wineBottonPath/drive_c/Program Files (x86)/Tencent/QQ/Bin/QQ.exe"], + ["TIM", "wineBottonPath/drive_c/Program Files/Tencent/TIM/Bin/TIM.exe"], + ["TIM", "wineBottonPath/drive_c/Program Files (x86)/Tencent/TIM/Bin/TIM.exe"] + ], + [ + ["cmd", "cmd"], + ["cmd", "cmd.exe"], + ["cmd", "wineBottonPath/drive_c/windows/system32/cmd.exe"], + ["Internet Explorer", "iexplore"], + ["Internet Explorer", "iexplore.exe"], + ["Internet Explorer", "wineBottonPath/drive_c/Program Files/Internet Explorer/iexplore.exe"], + ["Internet Explorer", "wineBottonPath/drive_c/Program Files (x86)/Internet Explorer/iexplore.exe"], + ["微信", "wineBottonPath/drive_c/Program Files/Tencent/WeChat/WeChat.exe"], + ["微信", "wineBottonPath/drive_c/Program Files (x86)/Tencent/WeChat/WeChat.exe"], + ["UltraISO", "wineBottonPath/drive_c/Program Files/UltraISO/UltraISO.exe"], + ["UltraISO", "wineBottonPath/drive_c/Program Files (x86)/UltraISO/UltraISO.exe"], + ["迅雷", "wineBottonPath/drive_c/Program Files/Thunder Network/MiniThunder/Bin/ThunderMini.exe"], + ["迅雷", "wineBottonPath/drive_c/Program Files (x86)/Thunder Network/MiniThunder/Bin/ThunderMini.exe"], + ["Microsoft Office Word", "wineBottonPath/drive_c/Program Files/Microsoft Office/Office12/WINWORD.EXE"], + ["Microsoft Office Word", "wineBottonPath/drive_c/Program Files (x86)/Microsoft Office/Office12/WINWORD.EXE"], + ["腾讯会议", "wineBottonPath/drive_c/Program Files/Tencent/WeMeet/wemeetapp.exe"], + ["腾讯会议", "wineBottonPath/drive_c/Program Files (x86)/Tencent/WeMeet/wemeetapp.exe"], + ["腾讯课堂", "wineBottonPath/drive_c/Program Files/Tencent/EDU/bin/TXEDU.exe"], + ["腾讯课堂", "wineBottonPath/drive_c/Program Files (x86)/Tencent/EDU/bin/TXEDU.exe"] + ] +] \ No newline at end of file diff --git a/Makefile b/Makefile index e505ca6..014f268 100755 --- a/Makefile +++ b/Makefile @@ -16,6 +16,10 @@ build: cp -rv AllInstall.py deb/opt/apps/deepin-wine-runner cp -rv kill.sh deb/opt/apps/deepin-wine-runner cp -rv InstallWineOnDeepin23Alpha.py deb/opt/apps/deepin-wine-runner + cp -rv wrestool deb/opt/apps/deepin-wine-runner + cp -rv deepin-wine-easy-packager.py deb/opt/apps/deepin-wine-runner + cp -rv IconList.json deb/opt/apps/deepin-wine-runner + cp -rv GetEXEVersion.exe deb/opt/apps/deepin-wine-runner echo "[]" > deb/opt/apps/deepin-wine-runner/wine/winelist.json rm -rfv deb/opt/apps/deepin-wine-runner/wine/winelist.json cp -rv req deb/opt/apps/deepin-wine-runner diff --git a/deb/DEBIAN/control b/deb/DEBIAN/control index b662acf..bfb0d41 100755 --- a/deb/DEBIAN/control +++ b/deb/DEBIAN/control @@ -1,5 +1,5 @@ Package: spark-deepin-wine-runner -Version: 2.5.0-uos +Version: 2.6.0~alpha1 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/deepin-wine-easy-packager.py b/deepin-wine-easy-packager.py index c381d6c..e0d2a65 100644 --- a/deepin-wine-easy-packager.py +++ b/deepin-wine-easy-packager.py @@ -417,6 +417,8 @@ class RunThread(QtCore.QThread): self.RunCommand(f"rm -rfv '{lnkPath}'") self.RunCommand(f"mkdir -pv '{bottlePath}'") self.RunCommand(f"chmod 777 -Rv '{bottlePath}'") + # 禁止生成 .desktop 文件 + self.RunCommand(f"WINEPREFIX='{bottlePath}' deepin-wine6-stable 'reg' 'add' 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe '/f'") # 安装包 global pressCompleteDownload pressCompleteDownload = False @@ -455,7 +457,15 @@ class RunThread(QtCore.QThread): exeName = os.path.splitext(os.path.basename(folderExePath))[0] exePathInSystem = rightLnk[1].replace("\\", "/").replace("c:", f"{bottlePath}/drive_c") debPackageVersion = self.GetEXEVersion(exePathInBottle) - self.RunCommand(f"'{programPath}/wrestool' '{UnUseUpperCharPath(exePathInSystem)}' -x -t 14 > '{debBuildPath}/{programIconPath}'") + cpNow = False + for i in iconList: + path = i.replace("wineBottonPath", bottlePath).lower() + if path == exePathInSystem.lower(): + self.RunCommand(f"cp -rv '{UnUseUpperCharPath(path)}' '{debBuildPath}/{programIconPath}'") + cpNow = True + break + if not cpNow: + self.RunCommand(f"'{programPath}/wrestool' '{UnUseUpperCharPath(exePathInSystem)}' -x -t 14 > '{debBuildPath}/{programIconPath}'") else: #/home/gfdgd_xi/Desktop/新建文件夹1/BeCyIconGrabber.exe # 绿色软件 @@ -564,6 +574,10 @@ if __name__ == "__main__": programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string iconPath = "{}/deepin-wine-runner.svg".format(programPath) information = json.loads(ReadTxt(f"{programPath}/information.json")) + iconListUnBuild = json.loads(ReadTxt(f"{programPath}/IconList.json"))[0] + iconList = json.loads(ReadTxt(f"{programPath}/IconList.json"))[1] + for i in iconListUnBuild: + iconList.append(i) app = QtWidgets.QApplication(sys.argv) version = information["Version"] window = QtWidgets.QMainWindow() diff --git a/mainwindow.py b/mainwindow.py index b52d570..21694bd 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -2190,33 +2190,8 @@ try: threading.Thread(target=requests.get, args=[parse.unquote(base64.b64decode("aHR0cDovLzEyMC4yNS4xNTMuMTQ0L3NwYXJrLWRlZXBpbi13aW5lLXJ1bm5lci9vcGVuL0luc3RhbGwucGhw").decode("utf-8")) + "?Version=" + version]).start() except: pass -iconListUnBuild = [ - ["QQ", "wineBottonPath/drive_c/Program Files/Tencent/QQ/Bin/QQ.exe"], - ["QQ", "wineBottonPath/drive_c/Program Files (x86)/Tencent/QQ/Bin/QQ.exe"], - ["TIM", "wineBottonPath/drive_c/Program Files/Tencent/TIM/Bin/TIM.exe"], - ["TIM", "wineBottonPath/drive_c/Program Files (x86)/Tencent/TIM/Bin/TIM.exe"] -] -iconList = [ - ["cmd", "cmd"], - ["cmd", "cmd.exe"], - ["cmd", "wineBottonPath/drive_c/windows/system32/cmd.exe"], - ["Internet Explorer", "iexplore"], - ["Internet Explorer", "iexplore.exe"], - ["Internet Explorer", "wineBottonPath/drive_c/Program Files/Internet Explorer/iexplore.exe"], - ["Internet Explorer", "wineBottonPath/drive_c/Program Files (x86)/Internet Explorer/iexplore.exe"], - ["微信", "wineBottonPath/drive_c/Program Files/Tencent/WeChat/WeChat.exe"], - ["微信", "wineBottonPath/drive_c/Program Files (x86)/Tencent/WeChat/WeChat.exe"], - ["UltraISO", "wineBottonPath/drive_c/Program Files/UltraISO/UltraISO.exe"], - ["UltraISO", "wineBottonPath/drive_c/Program Files (x86)/UltraISO/UltraISO.exe"], - ["迅雷", "wineBottonPath/drive_c/Program Files/Thunder Network/MiniThunder/Bin/ThunderMini.exe"], - ["迅雷", "wineBottonPath/drive_c/Program Files (x86)/Thunder Network/MiniThunder/Bin/ThunderMini.exe"], - ["Microsoft Office Word", "wineBottonPath/drive_c/Program Files/Microsoft Office/Office12/WINWORD.EXE"], - ["Microsoft Office Word", "wineBottonPath/drive_c/Program Files (x86)/Microsoft Office/Office12/WINWORD.EXE"], - ["腾讯会议", "wineBottonPath/drive_c/Program Files/Tencent/WeMeet/wemeetapp.exe"], - ["腾讯会议", "wineBottonPath/drive_c/Program Files (x86)/Tencent/WeMeet/wemeetapp.exe"], - ["腾讯课堂", "wineBottonPath/drive_c/Program Files/Tencent/EDU/bin/TXEDU.exe"], - ["腾讯课堂", "wineBottonPath/drive_c/Program Files (x86)/Tencent/EDU/bin/TXEDU.exe"] -] +iconListUnBuild = json.loads(readtxt(f"{programPath}/IconList.json"))[0] +iconList = json.loads(readtxt(f"{programPath}/IconList.json"))[1] for i in iconListUnBuild: iconList.append(i) print(iconList)