DMG tutorial
You will need
- Your macOS application
- (optional) A background image
- 10 minutes
Steps
-
Right click your app and look at its size. Note this down or remember it as {TOTAL_SIZE}. If you have a background image, add its size to {TOTAL_SIZE} as well
-
Launch
Disk Utility
-
File > New Image > Blank Image...
-
Field name Value Save As {APP_NAME}_installer_RW Name {APP_NAME}_installer Size {TOTAL_SIZE} (round to 10MB ceiling) Format Mac OS Extended (Journaled) Encryption none Partitions Single partition - GUID Partition Map Image Format read/write disk image -
Save it to Desktop
-
Open the Drive you just created and put your macOS application in it by dragging
-
Create a shortcut (an alias) of your Applications folder on your desktop by navigating to the folder containing the Applications folder, pressing and holding both the
alt
andcommand
keys and dragging it directly to your Desktop -
Put this shortcut to your Applications folder in the Drive by dragging
-
(optional) Put your background image in the Drive by dragging
-
(optional) Right-click the blank space in the Drive and select
Show View Options
-
(optional)
Background > Picture
and drag the image to the box -
(optional) If you have set the background image, resize the window accordingly to match that image
-
(optional) Make sure
Sort By:
is set toNone
instead ofSnap to Grid
, and change the Icon Size to whatever is appropriate for your background image -
(optional) Move your icons to whereever they should go depending on the background image
-
(optional) Hide your image file by launching
Terminal
and using the commandcd /Volumes/{APP_NAME}_installer_RW
.After that use the command
mv {IMAGE_NAME} .{IMAGE_NAME}
(prefronting the image name with a period) -
Close the Drive and
Right-click > Eject
-
Launch
Disk Utility
again -
In
Disk Utility
, doImages > Convert...
-
Select the dmg file you just created with the name
{APP_NAME_installer_RW.dmg
. -
Field name Value Save As {APP_NAME}_installer Encryption None Image Format read-only -
Convert
Your DMG file has been created!
You may now delete the
{APP_NAME}_installer_RW.dmg
file.