FancyDMG

For several years I've wondered how software distributors created DMG files with there software bundled such that you could "drag" an Application over to an alias called "Applications". This copied the Application into your computer's /Applications folder. Usually there was an "arrow" between to two icons that indicated the direction to drag. That arrow was part of the background for the DMG's window. I searched the Web for ways to create such a DMG, and it seemed to be overly complicated. So I devised my own method, which I'll now describe.

First, I wanted an "arrow" image that I could place between two other items. I found one via a Web search for "right arrow image". I chose a narrow arrow on a white background. I used Shift-Cmd-4 to encircle the image leaving white space all around. That created a Screen-Shot on my Desktop. I used Preview to display the Screen-Shot, and then chose the "Select" tool to encircle the arrow leaving a narrow margin. I then did Cmd-c to copy that encircled image to my Clipboard.

I quit from Preview. Then, from Terminal.app in /Applications/Utilities, I created an empty file on my Desktop:

    • touch $HOME/Desktop/a

The file name didn't matter, so I simply chose "a". Now "a" is visible on my Desktop. I single clicked it, and then did Cmd-i to Get Info, which has the icon of the file. Single click the icon (to choose it), and then do Cmd-v to paste the Clipboard, replacing the icon with the right-arrow (smaller image). Cmd-w to close the Get Info window. I now have a file called "a" with the icon I want. Leave it here on your Desktop. We'll come back to it soon.

Now, create a new "Untitled folder" on your Desktop. Shift-Cmd-n does that. Single-click on the folder, and then single-click on its name (below the folder). This highlights the name so you can rename it. I called my folder "Seeder" (without the quotes). Drag your "a" file into this new folder.

At this point, you need to populate your new folder with copies of the items you plan to distribute in your final DMG. I had three (3) items, one called "SelectAll" in /Applications, and two others in /Users/Shared. You can have other components anywhere. Copy them to this new folder.

In my case, I opened a Finder window to /Applications and Option-dragged my application from there into Seeder. I then navigated to /Users/Shared, and did Option-drag for each of the other components into Seeder.

Now I used Terminal.app again and navigated to $HOME/Desktop/Seeder, which has my components and the "a" file. Since I needed three arrows, one for each of the three components, I copied "a" to three different files, each with invisible names, like this:

    • cp a ' ' cp a ' ' cp a ' '

Notice that each of these copies has one, two, and three blanks in their names. If you need to know which is which, I recommend to wait over a minute between each "cp" above. Then, when you do something like "ls -l", each will show a completely blank name, but with a different timestamps.

OK, what else is needed in Seeder? Answer: the destinations for each component. I had two destinations, one of which is a repeat of the other. Let's do them in order.

    • ln -s /Applications Applications ln -s /Users/Shared Shared1 ln -s /Users/Shared Shared2

Those last two have different names, but point to the same place: /Users/Shared; Our Seeder folder is now ready with all triplets of source, arrow, destination.

=====================================

The next major task is to create the distribution DMG. That's a three-step process.

Step 1: Create an empty DMG that can be populated.

With Finder, launch "Disk Utility" from /Applications/Utilities. Click the "New Image" button (upper center control bar). This opens another window. Make these changes:

    • Save As: temp.dmg (must have .dmg suffix) Desktop (from the menu below Save As) Volume Name: SelectAll (or whatever you want to call the final DMG) Volume Size: 10MB (10MB holds about 400KB of data)

NOTE: Cmd-i on your Seeder folder, and multiply the size by 30 to get Volume Size. You'll also want a read/write disk image. No partition map is needed. Click "Create" to create "temp.dmg" on your Desktop. If it isn't opened by Disk Utility, double-click the dmg-icon to open it. What you should see is a window called SelectAll (or whatever distribution name you entered for Volume-Name).

Step 2: Populate the empty Volume-Name window.

From Finder's "View" menu, click "as Icons", if it isn't already that way. Now open your "Seeder" folder, select each of your "source" components, and drag them into the disk-image window in a column on the left side. I had three to drag: SelectAll (the application), fixfile, and fixsafari (/Users/Shared files). I then dragged each of the blank-named files with the arrow-icon into the center column of the window, to the right of each component. Finally, I dragged each destination into the right column of the window, to the right of the arrows.

Using Finder's View menu, click "Show View Options" and check the box at the top that says to always show the view as icons, and then adjust the icon sizes with the slider until the window looks the way you want to recipient to see it. I used 84x84 icons. Resize the window as needed. Now, Close the window, and then single-click the opened Volume-Name, and Cmd-e to "eject" it.

Step 3: Build the final DMG from the populated DMG:

Launch "Disk Utility" again, if it isn't still open. Click the "temp.dmg" icon in the lower-left column. Then click the "Convert" button along the top control bar. You may have to navigate to the "temp.dmg" on your Desktop. Click to open it, and replace "temp" in Save As: by the Volume-Name you originally selected, along with a .dmg suffix. Then verify the Image Format is set to "compressed", and if not, choose "compressed". Finally, click the "Save" button. Your final DMG should now be on your Desktop, with "Volume-Name.dmg" as its name.

If you double-click that disk-image, your true "SelectAll" will appear. Cmd-e will "eject" it. Or, double-click to open it. Your final DMG is what you want to distribute. You can Quit from Disk Utility, and trash "temp.dmg". Here's an image of my SelectAll.dmg, and you can see why I needed three differently named arrows, and two differently named pointers to the /Users/Shared directory.

SelectAll DMG