From 5b82e375d79e7d890a434cceeff1166564823751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E6=97=AD?= Date: Wed, 11 Oct 2023 09:15:31 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- publish.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/publish.py b/publish.py index a8b9ad2ce..30d08511c 100644 --- a/publish.py +++ b/publish.py @@ -131,16 +131,19 @@ def remove_folder(folder): # ##################################################################### +# 取最新的 Windows SDK windowsSdkDir = sorted(glob.glob(programFilesX86Path + "\\Windows Kits\\10\\bin\\10.*"))[-1]; makepriPath = windowsSdkDir + "\\x64\\makepri.exe" if not os.access(makepriPath, os.X_OK): raise Exception("未找到 makepri") +# 将 resources.pri 的内容导出为 xml if os.system("\"" + makepriPath + "\" dump /dt detailed /o") != 0: raise Exception("dump 失败") xmlTree = ElementTree.parse("resources.pri.xml") +# 在 xml 中删除冗余资源 for resourceNode in xmlTree.getroot().findall("ResourceMap/ResourceMapSubtree/ResourceMapSubtree/ResourceMapSubtree/NamedResource"): name = resourceNode.get("name") @@ -181,6 +184,7 @@ def remove_folder(folder): """, file=f) +# 将 xml 重新封装成 pri os.system("\"" + makepriPath + "\" new /pr . /cf priconfig.xml /in Magpie.App /o") os.remove("resources.pri.xml")