In this post, I’m going to show you how to create a beautiful *.dmg file to your app with only free software.
First, create a folder that will have the *.dmg contents. I’ll name it “our_app”, but do as you wish. Place your Application Bundle inside the folder. Now, open Terminal and type:
ln -s /Applications/ Applications
This will create a symbolic link for the Applications folder at your home folder, so just move it you your “our_app” folder.
Now, open iDMG and go to menu Window → Inspector. In the first tab, you can name the “Volume name” with you app name, as you wish. In “Format”, choose “Read and Write”. Close the inspector. Now, drag the “our_app” folder to iDMG. It will create a “our_app.dmg” file.
Open the “our_app.dmg” to mount it, and open the mounted device on Finder. Press Cmd+J and it will show this Window:
In “Background”, choose “Picture” and drag the desired background image to the box where it says “Drag image here”, or double click the block and choose the background image. Close this window and, back to finder, reorganize your files positions as you wish. Now, we need to hide the toolbar of the window – this is very tricky, so do exactly as I say. To do that, go to menu View → Hide Toolbar. Now, close your Finder and find your mounted device at the desktop. Right click it and choose “Eject”.
It should be ready, but there’s a problem: when we click in the dmg file, it mounts the device, but don’t open a new Finder window. To do that, our dmg must be Ready only. So, we’re going to convert it!
Now, open terminal and go to the folder where your our_app.dmg is located (type: “cd /path/to/folder” or type “cd” and drag the folder to the terminal, and press ENTER). Now, type this:
hdiutil convert -format UDZO -o our_app_ready.dmg our_app.dmg
This will create a new dmg called “our_app_ready.dmg” which is our nice dmg, fully working! Double click it and check if it’s working. You can rename the dmg file as you wish.
Hope it’s useful. If you have some questions, use the comments page.