I learned early on in my software career that packaging up a release of an application can be a real pain. Not only is it time consuming, but it is quite easy to forget a file or miss something when there are so many steps involved and you have to do it frequently. The solution to this is to automate the process. Putting together scripts to package up a release helps avoid missing steps and speeds up development and deployment of releases and updates.
One of the challenges of automating this on Mac OS X is figuring out how to script the creation of Apple disk image (DMG) files. Getting the arguments to hdiutil correct can be quite a challenge! In this post, I’ll give an example of a script I use to do the following:
- Copy all the necessary files to a staging area
- Strip and compress the executable files and libraries
- Create a DMG of the correct size for the release
- Add a link to /Applications to the DMG
- Add a background to the DMG so when it opens up your company logo or application graphic appears
- Check the background image’s DPI to ensure it is 72. Fix it if it’s not.
- Resize the window and icons, and position items in the DMG so when it opens everything is in the right place
- Create a final, compressed DMG
Let’s take a look… Read the remainder of this entry »