[Adium-devl] Let's abandon disk images
Peter Hosey
boredzo at gmail.com
Mon Apr 16 09:55:03 UTC 2007
On Apr 09, 2007, at 18:24:28, Peter Hosey wrote:
> On Apr 09, 2007, at 18:22:31, Augie Fackler wrote:
>> … we should make sure to not simply assume "oh, I'm on a disk
>> image, the user is wrong."
>
> Yup. We need to look for *our* disk image specifically.
Paul Kim blogged about the warning-when-running-from-a-disk-image idea:
http://www.noodlesoft.com/blog/2007/04/15/a-modest-proposal-a-new-way-
to-install
(Presumably the topic made its way from here to #macsb, which got him
on the subject.)
Two solutions come up in the comments. One was previously suggested
here by samsamoa:
> - Put a file inside of the disk image that can identify it as ours.
> (If it exists at Adium.app's level, then we need to copy ourself.)
>
> - When Adium launches, check to see if that file exists. If so, do
> the whole dialogue thing, copy Adium (somehow figure out copying
> permissions, too)
Brian Webster suggests the same thing.
Tom Harrington brings up a much more interesting idea:
> Depending on needs, you might want to consider using Rainer
> Brockerhoff’s new and excellent PathProps code (http://
> www.brockerhoff.net/src/index.html). This gives you a new category
> on NSWorkspace which adds a method that will tell you all kinds of
> interesting details about a given path, based on IOKit lookups.
> This could be used to specifically determine if you’re on a disk
> image, without resort to hacks like including hidden files or the
> potential errors of checking the path to your bundle and making
> assumptions based on that. It’ll even give you the full path to the
> disk image file that the image was mounted from.
Reading the description on Brockerhoff's page, it looks like it came
from the same discussion. And it works for me:
{
"NSWorkspace_RBconnectiontype" = "Virtual Interface";
"NSWorkspace_RBdeviceinfo" = "Disk Image; 10.4.9v114.9; Apple";
"NSWorkspace_RBfstypename" = hfs;
"NSWorkspace_RBimagefilepath" = "/Users/prh/Disk Images/
Adium_1.0.2.dmg";
"NSWorkspace_RBmntfromname" = "/dev/disk4s2";
"NSWorkspace_RBmntonname" = "/Volumes/Adium X 1.0.2";
"NSWorkspace_RBpartitionscheme" = "Apple_partition_scheme";
}
We could use this by getting info on the main bundle, and if it has
NSWorkspace_RBimagefilepath and that key's value ends with /
Adium_*.dmg, then we are running from the disk image.
___________________________________
\ Peter Hosey / boredzo at adiumx.com
PGP public key ID: C6550423 (since 2007-01-01)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://adium.im/pipermail/devel_adium.im/attachments/20070416/1d40a27e/attachment.sig>
More information about the devel
mailing list