JTechDev

Creating a Mac Disk Image Installer

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”.

Creating-Mac-Disk-Installer-Shot#1 Disk Utility will pop up a dialog asking what you want to name the disk image. Name it whatever you like, but make sure the image format is “read/write” as shown in the image below:

Creating-Mac-Disk-Installer-Shot#2

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.

Creating-Mac-Disk-Installer-Shot#3

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”.

Creating-Mac-Disk-Installer-Shot#4Move this alias to the mounted disk image you just created. Also move your application (or whatever you wanted in the installer) into the mounted disk image.

Creating-Mac-Disk-Installer-Shot#5It should look something like the image above.

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”.

Creating-Mac-Disk-Installer-Shot#6When you click “Show View Options”, you should see a dialog pop up. In this dialog there are three radio buttons:

  • White
  • Color
  • Picture

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.

Creating-Mac-Disk-Installer-Shot#7 Rescale the window till the image fits perfectly.

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:

Creating-Mac-Disk-Installer-Shot#9

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:

Creating-Mac-Disk-Installer-Shot#10

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”.

Creating-Mac-Disk-Installer-Shot#11

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.