Archive for July, 2005

Creating a .dmg for installation

Having been talked out of making an installer, I still wanted to be able to automate the creation of a .dmg file for easy deployment. Fortunately, this is very simple to do if you don’t want the .dmg to do much.

The short version is:


 % hdiutil create -srcfolder dist/[app name].app [app name].dmg

With [app name] replaced with the name of your application. Obviously, you need to do a proper build of your Python application, the symbolically linked version isn’t good enough.

For example, the Date List sample app can be deployed with:


 % rm -rf dist
 % python setup.py py2app
 % hdiutil create -srcfolder dist/Date List.app Date List.dmg

There are a range of features that are worth adding to a .dmg that is used to deploy software. These include things like background images, license agreements and auto opening the disk image.

This is something to investigate at a future point. The buildDMG script seems to be a good starting point, with the source of Adium providing a good example of how to build one.

Update

It’s been a while since I posted, due to a few other things going on. I also have a couple of articles in the wings that are waiting for me to finish.

On another note, Apple has dropped support for the Java-Objective C bridge. What this means is that if you were using Java for Cocoa development you are now out in the cold. This could lead to more people using Python or Ruby for Cocoa development.

PyObjC patterns

PyObjC - First Steps. Bob Ippolito has posted some common usage patterns for calling Objective C from Python.

Even if you have been using PyObjC for a while, this is a refresher worth reading.

House

For a bit of a change in obsessions, I’ve been watching a lot of the tv series House, partially to recover from snowboarding, and partially to turn my brain off by watching others learn and solve problems.

Classic quote:

House: “You’re British”

Chase: “I’m Australian”

House: “You put the Queen on your money. You’re British”