Creating an Installer DMG

Making a nice looking installer DMG with background is not too hard to do. The following 4 steps will guide you through the process.

Create a folder and add the contents

Create a folder on your Desktop, name it My Installer Template and add the dmg contents:

  • Your application
  • A shortcut to the Application folder
  • Optional: A background image (PNG). Note that you need to add the background image to the dmg contents otherwise the background will be only visible on the mac that was used to create the installer dmg.

Create a readable/writable disk image

Use Disk Utility.app to create a Disk Image based on the folder that you just created (just type: "Disk Utility" in Spotlight and press enter)

Open the Disk Utility.app and

File -> New Image -> Image From Folder… (SHIFT-CMD-N)  File -> New Image -> Image From Folder… (SHIFT-CMD-N)

The new dmg (My Installer Template.dmg) is located IN the folder that was been used to create the dmg!

Set the layout of the dmg window

  • In the Finder: open/mount My Installer Template.dmg 
  • Select: Show View Options… (CMD-J)
  • Choose Picture in in the Background pane (if you don’t see the option, check that you have selected the correct finder window (My Installer Template.dmg)
  • Drag the background image to the image field
  • Optional: Select the dmg and press CMD-I (Get Info) from the dmg and copy the desired icon to the dmg.
  • Optional: hide the background file so that the use won’t see the file residing in the dmg: 
  • In the Terminal.app, type: chflags hidden "/Volumes/My Installer Template/My Background.png”
  • (Make sure to include the quotes if you have spaces in the file/folder names)
  • Eject the dmg!







Change the disk image format to readonly

Finaly, we change the format of the dmg to a compressed readonly disk image. We do this with the hdiutil command using the Terminal.app. Make sure the DMG is ejected.

Open the Terminal.app and type: 

  • cd ~/Desktop
  • hdiutil convert "My Installer Template.dmg" -format UDZO -o MyInstaller.dmg

hdiutil will convert the My Installer Template.dmg to a new dmg (-o MyInstaller.dmg) with a new format UDZO (UDIF zlib-compressed image). This is a read-only compressed dmg.

In case you get an error message: convert failed - Resource temporarily unavailable. You most likely forgot to eject the source dmg (My Installer Template.dmg). Eject the dmg and try again.

© Plauw 2014-2019 - Cookie free website