Re: [gtk+osx] Working .app bundles
Status: Beta
Brought to you by:
jralls
From: Bob I. <bo...@re...> - 2004-01-06 01:04:29
|
On Jan 5, 2004, at 7:46 PM, Chris Sarcone wrote: > It would probably be better to craft a /bin/sh script rather than rely > on perl or python being installed. I'm not much of a scripter, but you > could try this out to see what happens: On OS X 10.3, there's a separate location for Python that you can depend on in the depths of /System/Library/Frameworks/Python.framework .. In any case, shell scripts are no good because they don't have execve like Python does and this is necessary to maintain the argv[0] and such in order to make WindowServer happy. > However, I think the best way to fix this is to fix apps which expect > command line arguments to explicitly check for them and not barf when > they get passed an option like -psn. I don't agree with this at all. A command line application should always throw an error if you pass a misspelled or erroneous configuration flag. The real solution is to use a separate executable for GUI launching of the application, or at least use a specific-to-gui-launching trap such as my main hack or an execve wrapper (ideally one written in C, not a scripting language). The problem with the main hack (but not the execve wrapper) is that it doesn't modify the stack representation of argv... so stuff like NXArgv, stack peeking, or usage of <crt_externs.h> are all going to show the original "-psn" argv. execve gets around this because it's a "brain wipe" of the process and is much simpler than trying to do it in-place with a stack that you're currently using. -bob |