• 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: now it really gets weird
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: now it really gets weird


  • Subject: Re: now it really gets weird
  • From: Jeff Harrell <email@hidden>
  • Date: Thu, 17 Jul 2003 12:08:07 -0500

On Thursday, July 17, 2003, at 11:14 AM, Eliah Kagan wrote:

In fact, if you make a new folder and call it something ending in .app, and then you double click on it in the Finder, it will look just like an app starting up. It just won't do anything.

Since we're elaborating...

What the Finder actually does at this point is look for a file inside the package (the .app folder) called Contents/Info.plist. If it finds one, it does reads it and acts accordingly. (A full discussion of what Info.plist is and does is beyond the scope of my knowledge, plus it's tangential to where I'm going with this.)

If there's no Info.plist file, the Finder looks for any file at the path Contents/MacOS/PackageBaseName and tries to execute it. What I mean by that is that if you've got a package called "Hello.app" and you double-click it, the Finder will look for Hello.app/Contents/Info.plist first, then barring that it will look for Hello.app/Contents/MacOS/Hello and try to execute it.

This is handy to know because you can put ANY executable file, even a shell or Perl script or whatever, and put it inside a package to make it double-clickable. If you do this, the file that gets executed is simply exec'd by the Finder; it doesn't get a controlling terminal or anything fancy-schmancy like that. Sometimes this is what you want.

The only catch is that Hello.app/Contents/MacOS/Hello (or whatever) has to be executable. In other words, the execute bit has to be set.

--
email@hidden
http://homepage.mac.com/jharrell
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: now it really gets weird (From: Eliah Kagan <email@hidden>)

  • Prev by Date: Re: now it really gets weird
  • Next by Date: Re: now it really gets weird
  • Previous by thread: Re: now it really gets weird
  • Next by thread: Re: now it really gets weird
  • Index(es):
    • Date
    • Thread