Re: Moving oneself to /Applications (or ~/Applications)
Re: Moving oneself to /Applications (or ~/Applications)
- Subject: Re: Moving oneself to /Applications (or ~/Applications)
- From: Michael Ash <email@hidden>
- Date: Tue, 24 Feb 2009 21:15:32 -0500
On Tue, Feb 24, 2009 at 12:34 AM, Tommy Nordgren
<email@hidden> wrote:
>
> On Feb 24, 2009, at 3:34 AM, Shawn Erickson wrote:
>
>> On Mon, Feb 23, 2009 at 6:22 PM, Tommy Nordgren
>> <email@hidden> wrote:
>>>
>>> The following code will test if you are running from the DMG:
>>>
>>> NSString * volName = @"Mother";
>>> NSString * appName = @"MyApp.app";
>>>
>>> if ([[[NSBundle mainBundle] bundlePath] isEqualTo: [ NSString
>>> stringWithFormat:@"/Volumes/%@/%@",volName,appName]) {
>>>
>>> //Here you can show an alert telling the user to to copy the app to
>>> the applications folder
>>>
>>> }
>>
>> If a disk image it mounted a second time (can happen in a few ways) it
>> won't be at /Volumes/Mother/... but at /Volumes/Mounter 1/... Also you
>> can mount disk images in location other then under /Volumes/...
>>
>> If you really want to check this you should utilize
>> DiskImages.framework (IIRC) or possibly use "hdutil info -plist" and
>> look for your disk image and its current mount location. Then compare
>> that to your bundles location.
>>
>> -Shawn
>
> Unfortunately, the DiskImages framework is private (no headers)
> Getting the output of hdiutil is a little awkward since the NSDictionary
> class has no method to initialize from a pipe.
It is precisely three method calls to go from an NSPipe to an
NSDictionary. If that qualifies as "a little awkward" then I must add
a bit extra to my usual despair for humanity.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden