• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Running from DMG
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running from DMG


  • Subject: Re: Running from DMG
  • From: Dirk Stegemann <email@hidden>
  • Date: Sun, 11 Feb 2007 18:06:51 +0200

Hello,

Am 11.02.2007 um 17:59 schrieb Jim Thomason:

how about using "hdiutil info -plist"? That'll give you
information about the currently mounted disk images, in a convenient
plist format.

This does indeed seem like a better way to solve this issue!

Best,
Dirk Stegemann




On 2/11/07, Dirk Stegemann (Mailing-Lists) <email@hidden> wrote:
Hello Brad,

you could use the hdiutil tool to try to unmount the volume your
running application resides on. The unmount process itself should
fail, though, but the error differs for different situations.
E.g. failing to umount a disk image your app is running from contains
the error code "49153".
Failing to umount a network share will result in "no such file or
folder".

hdiutil detach /Volumes/TheVolumeYourAppResidesOn/


The exact error message might differ between system versions, especially as these error messages posted by hdiutil are localized (unfortunately). So you will have to experiment a bit and parse hdiutil's output.

Also, the hdiutil man page (<x-man-page://hdiutil>) states that using
the "/Volumes/yourvolumename/" path to unmount a disk image does work
for Mac OS X 10.4 systems only – the Mac OS X 10.3 version of hdiutil
expects the device path (e.g. "/dev/disk1s2").
Run "hdiutil attach /path/to/your/diskimage" to see your mounted disk
image's device path. I do not know the tool(s) used to get the device
path for a certain mounted volume...

hth

Best regards,
Dirk Stegemann



Am 11.02.2007 um 16:53 schrieb Brad Peterson:

> Hi all,
>
> I know there's a way for an app to determine if it's
> running from a mounted removable volume (just get the
> path, see if it's in the NSWorkspace
> mountedRemovableMedia list).
>
> However, I'd like to be more specific than that and
> determine whether I'm running from a mounted DMG. The
> DMG could be writable, so the usual checks for, say, a
> CD don't apply here.
>
> Any thoughts?
>
> Thanks!
>
> B
>
>
>
>
> _____________________________________________________________________ _
> ______________
> Need Mail bonding?
> Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
> http://answers.yahoo.com/dir/?link=list&sid=396546091
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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:
> email@hidden
>
> This email sent to email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >Running from DMG (From: Brad Peterson <email@hidden>)
 >Re: Running from DMG (From: "Dirk Stegemann (Mailing-Lists)" <email@hidden>)
 >Re: Running from DMG (From: "Jim Thomason" <email@hidden>)

  • Prev by Date: Re: Running from DMG
  • Next by Date: [Q] Cocoa Object : Behavior when "retain" and "copy"?
  • Previous by thread: Re: Running from DMG
  • Next by thread: Re: Running from DMG
  • Index(es):
    • Date
    • Thread