dmgutil

dmgutil is a command line tool for creating, configuring, and compressing Mac OS X disk images for distribution.

By allowing you to programmatically create and manipulate disk images, dmgutil allows you to automate your build process and prepare releases without pre-existing templates or user interaction.

dmgutil allows you to adjust the size, position, and appearance of Finder windows. It can also apply custom icons to volumes, folders, or files.

dmgutil is Open Source, released under the BSD licence. Comments or suggestions are welcome.

Example Usage

To create a new disk image for your "MyApp 1.0" release, dmgutil can be invoked with:

dmgutil.pl --open --volume="MyApp 1.0" myapp_1.0.dmg

Once created, your build script should copy your files to the volume. dmgutil can be used to adjust the volume properties, such as a background image or window dimensions:

dmgutil.pl --set --iconsize=128 --background=flowers.jpg "/Volumes/MyApp 1.0" dmgutil.pl --set --x=20 --y=60 --width=300 --height=200 "/Volumes/MyApp 1.0"

You can also use dmgutil to set the position of files or folders within the volume:

dmgutil.pl --set --x=100 --y=100 "/Volumes/MyApp 1.0/Read Me.rtf" dmgutil.pl --set --x=200 --y=100 "/Volumes/MyApp 1.0/MyApp.app"

Additional parameters can be applied to adjust the background color and toolbar visibility of the window, or to apply custom icons to the volume or its contents.

Once your volume has been prepared, the disk image can be compressed for distribution with:

dmgutil.pl --close --volume="MyApp 1.0" myapp_1.0.dmg

By combining these commands in a simple shell script, the contents of your build folder can quickly and easily be turned into a user-friendly disk image ready for distribution.

Download

dmgutil is available from our download page.

The version history for previous releases is available here.