From 56cce440e30113e3adfc1b42ab16b15b12bc8f33 Mon Sep 17 00:00:00 2001 From: CorpNewt <12772521+corpnewt@users.noreply.github.com> Date: Mon, 7 Oct 2019 15:29:01 -0500 Subject: [PATCH] Add patches for InstallInfo.plist --- BuildmacOSInstallApp.command | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/BuildmacOSInstallApp.command b/BuildmacOSInstallApp.command index 74a587a..d4b40ba 100755 --- a/BuildmacOSInstallApp.command +++ b/BuildmacOSInstallApp.command @@ -12,6 +12,7 @@ class buildMacOSInstallApp: "BaseSystem.dmg", "BaseSystem.chunklist", "InstallESDDmg.pkg", + "InstallInfo.plist", "AppleDiagnostics.dmg", "AppleDiagnostics.chunklist" ] @@ -128,6 +129,17 @@ class buildMacOSInstallApp: out = self.r.run({"args":["cp","-R",os.path.join(f_path,x),os.path.join(shared_support,y)]}) if out[2] != 0: raise Exception("Copy Failed!", out[1]) + print("Patching InstallInfo.plist...") + with open(os.path.join(shared_support,"InstallInfo.plist"),"rb") as f: + p = plist.load(f) + if "Payload Image Info" in p: + pii = p["Payload Image Info"] + if "URL" in pii: pii["URL"] = pii["URL"].replace("InstallESDDmg.pkg","InstallESD.dmg") + if "id" in pii: pii["id"] = pii["id"].replace("com.apple.pkg.InstallESDDmg","com.apple.dmg.InstallESD") + pii.pop("chunklistURL",None) + pii.pop("chunklistid",None) + with open(os.path.join(shared_support,"InstallInfo.plist"),"wb") as f: + plist.dump(p,f) print("") print("Created: {}".format(install_app)) print("Saved to: {}".format(os.path.join(f_path,install_app))) @@ -146,4 +158,4 @@ class buildMacOSInstallApp: if __name__ == '__main__': b = buildMacOSInstallApp() - b.main() \ No newline at end of file + b.main()