#!/usr/bin/env python import sys donext = 0 tab = sys.argv[1:] for a in tab: if donext: path = a donext = 0 if a == "-srcfolder": donext = 1 import os for p in os.walk(path): if p[0].endswith("python.pkg"): pythondir = p[0] dest = os.path.join(pythondir, "Contents", "Resources") import shutil shutil.copy(os.path.join(os.path.dirname(__file__), "macpostinstall") ,os.path.join(dest, "postflight")) os.system("hdiutil %s" % " ".join(tab))