Create a good-looking DMG for your macOS app in seconds
Go to file
Sindre Sorhus fab154ff35 Handle app without an icon
Fixes #51
2020-04-20 20:32:38 +08:00
.github Enable the repo sponsor button 2019-05-26 12:39:53 +07:00
assets Init 2017-03-28 00:35:11 +07:00
fixtures Handle app without an icon 2020-04-20 20:32:38 +08:00
stuff Init 2017-03-28 00:35:11 +07:00
.editorconfig Meta tweaks 2017-10-23 19:35:26 +07:00
.gitattributes Meta tweaks 2019-05-12 23:51:17 +07:00
.gitignore Meta tweaks 2017-10-23 19:35:26 +07:00
.npmrc Meta tweaks 2017-10-23 19:35:26 +07:00
.travis.yml Meta tweaks 2019-05-12 23:51:17 +07:00
base.r Software licensing, support for pre-10.11 (#47) 2020-02-19 18:20:58 +07:00
cli.js Handle app without an icon 2020-04-20 20:32:38 +08:00
compose-icon.js Meta tweaks 2019-05-12 23:51:17 +07:00
disk-icon.icns Add mount device custom icon generation (#33) 2019-05-12 23:40:16 +07:00
icon-example-app.png Meta tweaks 2019-05-12 23:51:17 +07:00
icon-example.png Meta tweaks 2019-05-12 23:51:17 +07:00
license Meta tweaks 2017-10-23 19:35:26 +07:00
package.json 5.0.0 2020-02-19 18:30:03 +07:00
readme.md Readme tweaks 2020-02-19 18:28:18 +07:00
screenshot-cli.gif Improve description and CLI screenshot 2017-03-31 19:46:41 +07:00
screenshot-dmg.png Init 2017-03-28 00:35:11 +07:00
seticon Add mount device custom icon generation (#33) 2019-05-12 23:40:16 +07:00
sla.js Software licensing, support for pre-10.11 (#47) 2020-02-19 18:20:58 +07:00
test.js Handle app without an icon 2020-04-20 20:32:38 +08:00

readme.md

create-dmg Build Status

Create a good-looking DMG for your macOS app in seconds

Imagine you have finished a macOS app, exported it from Xcode, and now want to distribute it to users. The most common way of distributing an app outside the Mac App Store is by putting it in a .dmg file. These are hard to create, especially good-looking ones. You can either pay for a GUI app where you have to customize an existing design or you can run some homebrewed Bash script and you still have to design it. This tool does everything for you, so you can play with your 🐈 instead.

This tool is intentionally opinionated and simple. I'm not interested in adding lots of options.

Install

Ensure you have Node.js 8 or later installed. Then run the following:

$ npm install --global create-dmg

Usage

$ create-dmg --help

  Usage
    $ create-dmg <app> [destination]

  Options
    --overwrite          Overwrite existing DMG with the same name
    --identity=<value>   Manually set code signing identity (automatic by default)
    --dmg-title=<value>  Manually set title of DMG volume (only used if app name is >27 character limit)

  Examples
    $ create-dmg 'Lungo.app'
    $ create-dmg 'Lungo.app' Build/Releases

DMG

The DMG detects the minimum runtime of the app, and uses ULFO (macOS 10.11 or later) or UDZO as appropriate. The resulting image has the filename App Name 0.0.0.dmg, for example Lungo 1.0.0.dmg.

It will try to code sign the DMG, but the DMG is still created and fine even if the code signing fails, for example if you don't have a developer certificate.

Software license agreement

If either license.txt, license.rtf, or sla.r (raw SLAResources file) are present in the same directory as the app, it will be added as a software agreement when opening the image. The image will not be mounted unless the user indicates agreement with the license.

/usr/bin/rez (from Command Line Tools for Xcode) must be installed.

DMG icon

GraphicsMagick is required to create the custom DMG icon that's based on the app icon and the macOS mounted device icon.

Steps using Homebrew

$ brew install graphicsmagick imagemagick

Icon example

Original icon → DMG icon