Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sindresorhus/create-dmg
Create a good-looking DMG for your macOS app in seconds
https://github.com/sindresorhus/create-dmg
app cli cli-app disk-image dmg javascript macos nodejs
Last synced: 3 days ago
JSON representation
Create a good-looking DMG for your macOS app in seconds
- Host: GitHub
- URL: https://github.com/sindresorhus/create-dmg
- Owner: sindresorhus
- License: mit
- Created: 2017-03-27T17:24:44.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-01-30T10:16:23.000Z (11 months ago)
- Last Synced: 2024-10-29T15:02:06.344Z (about 1 month ago)
- Topics: app, cli, cli-app, disk-image, dmg, javascript, macos, nodejs
- Language: JavaScript
- Homepage:
- Size: 5.15 MB
- Stars: 4,704
- Watchers: 38
- Forks: 194
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
- awesome-github-star - create-dmg - looking DMG for your macOS app in seconds | sindresorhus | 4038 | (JavaScript)
- my-awesome-list - create-dmg - looking DMG for your macOS app in seconds | sindresorhus | 4728 | (JavaScript)
README
# create-dmg
> Create a good-looking [DMG](https://en.wikipedia.org/wiki/Apple_Disk_Image) 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](https://nodejs.org) 18 or later installed. Then run the following:
```sh
npm install --global create-dmg
```## Usage
```
$ create-dmg --helpUsage
$ create-dmg [destination]Options
--overwrite Overwrite existing DMG with the same name
--identity= Manually set code signing identity (automatic by default)
--dmg-title= Manually set DMG title (must be <=27 characters) [default: App name]Examples
$ create-dmg 'Lungo.app'
$ create-dmg 'Lungo.app' Build/Releases
```## DMG
The DMG requires macOS 10.13 or later and 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.
**Important:** Don't forget to [notarize your DMG](https://stackoverflow.com/a/60800864/64949).
### Software license agreement
If either `license.txt`, `license.rtf`, or `sla.r` ([raw SLAResources file](https://download.developer.apple.com/Developer_Tools/software_licensing_for_udif/slas_for_udifs_1.0.dmg)) 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](https://developer.apple.com/download/more/)) must be installed.
### DMG icon
[GraphicsMagick](http://www.graphicsmagick.org) is required to create the custom DMG icon that's based on the app icon and the macOS mounted device icon.
#### Steps using [Homebrew](https://brew.sh)
```sh
brew install graphicsmagick imagemagick
```#### Icon example
Original icon → DMG icon
## Related
- [Defaults](https://github.com/sindresorhus/Defaults) - Swifty and modern UserDefaults
- [LaunchAtLogin](https://github.com/sindresorhus/LaunchAtLogin) - Add “Launch at Login” functionality to your macOS
- [My apps](https://sindresorhus.com/apps)
- [More…](https://github.com/search?q=user%3Asindresorhus+language%3Aswift+archived%3Afalse&type=repositories)