In this tutorial, you will learn how to make a Mac OS X Disk Image Installer. I am making this tutorial because I could not find enough information on how to do it. Hopefully, this will help someone else looking for answers.
To begin, create a folder with the name of your application. In this example, it will be named application. After you have created the folder, open up disk utility and click “File » New » Disk Image From Folder”.
You should now have a readable and writable disk image where you saved it. Open this disk image. You should have a blank image like the one shown below.
This is because we haven’t added anything to it. There will be soon!
Now, make an alias of the Applications folder. Not the Applications folder in your home folder, but the one at “/Applications”.
Now, you will probably want a background image to make the whole this look nice. This must be in the mounted drive! This is because this disk image will be moving to different computers. The other computer will not have your image on it. And, no, Apple did not make it so that the image was automatically saved within the folder you set the image on.
First, take the image you want as the background and put it on the disk image. Once you have done that, right-click in the mounted disk image and click, “Show View Options”.
These decide the display of the background in this folder. Select picture and drag the picture you want from the mounted drive into the little box that says, “Drag image here”.
Once you have done that, you should have a background on the folder, but unless you made the image the perfect scale, the view of the folder should not be the right size.
Now, you are probably thinking to yourself, “Yeah, that looks nice, but what about the ugly image just sitting there for the user to see?” Well, it is a little more difficult to remove that, but I found the best way is with the terminal command below:
SetFile -a V file
This makes the file specified hidden and doesn’t even change the file name. So, with that command, not only do you have the image hidden, but you get to keep the background. After you do that, it should look something like the image below:
This is nice, but it would look a lot better if the icons were bigger. So, next, right-click and press “Show View Options”. Once again, you should see the View Options dialog. Now, under “Icon Size”, change it till you feel the size is right. Then, move the icons around till they are in the proper position. It may look something like this:
Once you are all finished making it look nice, it is time to set it up for distribution. First, open Disk Utility. Then, click the convert button. A dialog should show up asking where you want to save it. Make sure the Image Format is “compressed”.
Once you click save, it should create an non editable compressed disk image. This is perfect for distributing an application.
If you have any questions or comments, feel free to post below.