macoscocoainstallationsoftware-distributionpkg-file

How to generate an installer package for Mac app?


How can I create a single installer package for an OS X binary as well as a few configuration and script files?

Final folders should look like this:

https://i.sstatic.net/bFDcY.png

Any help would be appreciated. Thanks.


Solution

  • macOS does not normally use installers. Applications are packaged in app containers with the extension .app. This container is "executable" but you're also able to dig in and see what is inside. This is also the format distributed through App Store.

    You can create .pkg or .dmg "installers" if necessary, however this is clearly not something apple aims to be standard. I would advise to use the .app pattern and any scripts needed should be self contained and executed on first run.

    You can use .dmg to distribute your application outside of App Store (this is still fairly normal).

    macOS also includes a terminal program called productbuild that builds a product archive for the macOS Installer or the Mac App Store. Enter man productbuild into the Terminal on a Mac for the manual page.