Devesh
Devesh

Reputation: 203

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.

Upvotes: 17

Views: 43280

Answers (5)

seth
seth

Reputation: 1708

For posterity, another option: Package Builder is a modern fully-supported app for the latest versions of macOS.

The Apple command line tools can be a royal pain to get things right by yourself (speaking from personal experience! ugh), and the old Packages app no longer works and was a too complicated for the vast majority of uses IMO. Package Builder is easier and also ties into building disk images too. GUI and command line.

Upvotes: 0

Dionysis
Dionysis

Reputation: 824

There is no need to depend on external applications. For those comfortable with the command line you can use the utility pkgbuild directly.

Upvotes: 0

Mikeumus
Mikeumus

Reputation: 3878

There's also macOS Installer Builder, which is a CLI you can use to create an installer wizard for your .pkg: https://github.com/KosalaHerath/macos-installer-builder

Upvotes: 4

d00dle
d00dle

Reputation: 1316

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.

Upvotes: -3

bhaller
bhaller

Reputation: 2117

Installers are great if you want various things to be placed in different spots – app here, documentation there, support files over here, etc. They're also great for providing configurability of the installation experience (optional extras), or hand-holding for an unusual type of installation that the user might not otherwise understand, or extra work (configuration scripts, permissions modifications, authentication, compatibility checking, etc.) that need to run during the installation process. There is nothing wrong with installers, contrary to the answer from @d00dle, although there is also nothing wrong with distributing your app through the App Store, or as a dmg.

For setting up your own installers, I highly recommend a program called Packages (http://s.sudre.free.fr/Software/Packages/about.html). I am in no way connected to it, but I use it to build the installer for an app that I work on. It greatly smoothes the process of making a complex installer, and has an excellent GUI interface.

Upvotes: 18

Related Questions