[Adium-devl] Let's abandon disk images
Graham Booker
adium at cod3r.com
Sat Mar 31 23:56:45 UTC 2007
On Mar 31, 2007, at 6:23 PM, Peter Hosey wrote:
> On Mar 31, 2007, at 15:17:59, Evan Schoenberg wrote:
>> How can we detect if we're running form a disk image?
>
> Process Manager will tell us the path to the process's app bundle.
> From there, we can get a volume record from File Manager and
> inspect it for signs of the disk image nature.
[[NSBundle mainBundle] bundlePath] to get our path
If it starts with /Volumes, likely we are a disk image.
[[NSWorkspace sharedWorkspace] mountedRemovableMedia] to see the
mount points of all mounted disk images.
If our path is prefixed with one of these, then we are on another
disk. If the disk name starts with "Adium" (or whatever we name our
disk image) then it is extremely likely we are on our disk image. We
can simply pass this path to "hdiutil detach" to unmount it after we
are done.
> ___________________________________
> \ Peter Hosey / boredzo at adiumx.com
> PGP public key ID: C6550423 (since 2007-01-01)
- Graham
More information about the devel
mailing list