Snow Leopard Disk Image Issues.

I’m not entirely sure what Apple changed in Snow Leopard but  we quickly discovered that disk images created in Snow Leopard don’t work the same in Leopard and earlier systems.  When we create our disk images we have something that looks like this:

Disk Image

Looks fine in Snow Leopard.  Acts fine in Snow Leopard.  But when you take it into Leopard you get a disk image that looks something like this (no background image):

SL Disk Image in Leopard

Long time Mac users understand what to do but new Mac users were a little mystified at what to do.  Unfortunately we didn’t find this out until after a couple of releases, but we did find a solution.

We use a postbuild script to automatically create our disk image.  The bit of code is:

hdiutil convert -quiet  -format UDBZ -o “${IMAGE_NAME}.dmg” -imagekey zlib-level=9 “./${IMAGE_NAME}.sparseimage” \
|| error_exit “$LINENO: Could not compress the DMG”

This leaves a sparseimage file laying around and normally we get rid of it.  While running this in Leopard we didn’t and copied it.  This sparseimage has the proper graphics and works in Snow Leopard so we now use it as our template when doing builds in Snow Leopard.

We changed the script to delete the OLD file on the sparseimage using:

rm -rf “/Volumes/${MOUNTED_DISK_NAME}/Task Timer 4.app/Contents” \
|| error_exit “$LINENO: Could not delete old build”

Then we copy our newly created RB app into the sparse image.

rsync -a “${MAC_OUTPUT}/Task Timer 4.app/” “/Volumes/${MOUNTED_DISK_NAME}/Task Timer 4.app/” \
|| error_exit “$LINENO: Could not copy into volume”

So, it’s kind of pain to do, and it’s not very efficient but it works.  We are still using RB 2009 R3 because build automation that was released in R4 doesn’t work for us.

Update:  If you want to see the entire script, there is an article in the Articles section on the ARBP members only site, which is available to any paid membership.