Running On A Disk Image
I currently distribute IMLocation bundled on a disk image (details on why that format sucks but why I still do it).
Like many users, I will try out an application while it’s still on a disk-image before deciding if I want to install it. So I test to make sure IMLocation runs well off of a .dmg. I don’t think it’s reasonable to force people to install some software before they’re sure they want to keep it.
This is one more thing to test, but it’s pretty straightforward. So far I haven’t had anything break because it was running off a disk-image (*knock on wood*). (You can even make sparse disk images that will grow as you write new files to them — so if your program needs to modify itself it can; although there is no good reason for it to.)
But just running right isn’t good enough. I want to make things easy for people who hate IMLocation, and want to throw it away.
For IMLocation to do it’s magic, it uses a background process to monitor location, and inconspicuously do stuff for the user. The background process keeps doing it’s thing even when the “interface” or IMlocation.app is not running. Users never need to be aware of the background process. If it ever notices that the IMLocation.app has been thrown away, it will quietly uninstall itself, and any settings or other files IMLocation created on the computer.
But this caused a problem for disgruntled users. If they had launched IMLocation.app (and thus the background process), then quit IMLocaiton.app, they couldn’t unmount the disk-image to throw it away, because the background process that lived inside the IMLocation.app bundle on the disk was still in use. In that situation the Finder tells the user to “try quitting applications and try again”, but that wont solve their problem, because the offending process is invisible — there’s no way for them to “quit it”!
The solution was to copy the background process over to an IMLocation directory in the Application Support Folder. That way, no files except the IMLocation.app program itself on the disk-image were ever in use.
If your program ever launches any background application, it should do the same thing. If your program ever tells another application to open one of it’s files, you should be sure that the file is not on a disk image. Even though they can quit the other program to eject your disk, it’s still rude. There’s no good reason to force someone to quit a program they are using.
Someone may decide they don’t like your program right now, but become a user later on, after it improves, or their needs change. However, if you bundle your wares on a mysteriously unejectable .dmg, you can be sure that they will remember you with hatred.