Recently I was tasked with finding out a way to prepare OS X applications for automatic distribution to multiple machines.

Most applications require some tampering with their preferences before deploying. I have done it for Windows machines before, and usually I could just replace the preference files/registry entries right inside the .msi installer, using tools like Orca, Wise Package Studio and so on.

I am new to macs, but when I try to look for something similar for OS X, all I find is software to make packages from scratch (PackageMaker, Iceberg, etc.), but nothing for editing already created .pkg files.

So here is the question: is there a way to easily edit the content of .pkg file (replace some files, add a script, etc.), without having to install/unpackage it and then package the configured stuff back?

  • Do You have flat packages or bundles? Apr 7, 2014 at 14:40
  • @MateuszSzlosek, it is not specified, so I have to assume we can have both.
    – Boris
    Apr 7, 2014 at 16:00
  • @MateuszSzlosek, "flat" meaning?
    – Pacerier
    Feb 14, 2018 at 10:32
  • @Pacerier Apple introduced new pkg format "Flat Packade Format" on OS X 10.5 - more info s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html And a difference between the flat and bundled is that bundled package can be opened in Finder with RightClick -> "Show Package Content". Feb 14, 2018 at 11:44

2 Answers 2


You can use the Flat Package Editor from Apple.

  1. Go to Apple's Developer downloads site and download the Auxiliary Tools for Xcode - Late July 2012.
  2. Once downloaded, open the DMG.
  3. Find PackageMaker.app and open the package contents, then navigate to Contents/Resources.
  4. Copy Flat Package Editor.app to /Applications or elsewhere then open it.

From this app you can open a .pkg and edit the contents by dragging files out, editing them and dragging them back in, then saving the package.

Packages can be resigned using the button on the title bar:

  • Thanks, this tool looks useful. Doesn't work with bundles, but I guess it's an outdated format and I probably won't have to deal with it too much. Some sources claim it is quite buggy, though.
    – Boris
    Apr 8, 2014 at 10:23
  • I was able to find this download by searching apple's developer downloads. dropbox.com/s/ndjs39zalj3t9oy/… Jan 1, 2018 at 7:42

I am not aware of any Apple recommended tools to edit existing package, pkg or mpkg, files. Most packages are signed and thus any changes will invalidate their signature; although resigning is simple enough using pkgbuild and an appropriate installer certificate.

Wrapping Up Existing Packages

Consider creating a wrapper multi-package that adjusts any required files after installation. With this approach you can bundle up existing packages and then run post-install/update scripts as required.


There is little documentation about crafting packages as Apple traditionally relied on the graphical tool PackageMaker. Since Mac OS X 10.8, the PackageMaker tool has been replaced by the command line tools productbuild and pkgbuild.

The tool you will want to investigate is pkgbuild. This tool eases the creation of packages containing multiple packages and scripts. About Distribution Definition Files talks about the internal file format.

  • Thanks, I did consider wrapping packages instead of editing them, so I will look into it if Flat Package Editor won't be able to help me.
    – Boris
    Apr 8, 2014 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .