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")