Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

running a cocoa bundle's product via a shell script.



Hello.

Here's an interesting one. I've added a shell script build phase to my Cocoa app so that I can do some things to the application's environment before the app starts up.

The bundle is produced as whatever.app and I have an executable shell script produced in the whatever.app/Contents/MacOS/ directory along with the product that would normally be the only thing there (for me anyway). It does some chores and then runs the bundle's product with "exec"

Info.plist reflects that the shell script should be the thing executing because the CFBundleExecutable value is set to be the shell script.

If I run the app in Xcode, the shell script is ignored and the bundle's product is run (or so it appears).

If I run the app on the command line using "open" or double clicking in Finder, nothing happens. I just get a new prompt.

If I go into the bundle's MacOS directory, however, I can run the shell script manually and it launches the app, which does what I want it to do in the first place.

I think that the shell script is at least being checked for when I double click or use "open" because I get a message saying that the app can't open if I remove or rename the shell script to something else.

Can anyone provide insight here? I'm assuming that "open" and double clicking is associating the name "whatever" in "whatever.app" with the product "whatever" in the MacOS directory, and thereby ignoring the shell script specified in Info.plist.

Matthew

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.