Open Bug 307463 Opened 16 years ago Updated 4 years ago

nsProcess::init fails for Mac OS X application bundles (


(Core :: XPCOM, defect)

1.8 Branch
Not set




(Reporter: jruderman, Unassigned)




(1 file)

nsProcess::init fails for Mac OS X application bundles.  To use nsProcess to run
a Mac OS X application, I have to dig inside the .app and find the executable
This would probably work. It compiles, but I haven't tested it myself. I'll
leave it up to others to request review if they want once it has been tested.
I think we'd want to use Launch Services rather than the old LaunchApplication()
-- LSOpenFSRef(), LSOpenCFURLRef() or LSOpenApplication().

A question I have is which kind of apps nsIProcess should be able to open --
should it inlude command-line tools (/usr/bin/ls) for example?
nsIProcess should absolutely be able to open command-line tools. I would argue
really that bundle-launching is out of scope for nsIProcess, but if it can be
added without sacrificing direct executables then I suppose it wouldn't hurt.
For the record, I wasn't out to rewrite the whole thing. I don't really have
time to do that correctly right now. I just wanted to fix this bug.
Blocks: 172817
A branch-safe fix before Firefox 2.0 would be nice: using bug 172817's external editor for view-source fails here for (and in bug 322865 for
Blocks: 339893
This bug is a problem for dafizilla, see
 for their faq on the bug.
Any progress on this?  If not, can someone who knows what's going on explain the problem in so that other developers don't fall into this problem too?
mass reassigning to nobody.
Assignee: dougt → nobody
Thanks Frank Wein.

Unfortunately in FF4beta, nsIFilePicker's filterApps now handles OS-X applications sort-of-correctly now (it won't let you pick files that have the executable bit set -- it only lets you pick .app applications).  So now this is doubly annoying.

Under OS-X you cannot let a user pick an application and then run it with arguments. 

So basically, we've gone backwards -- I will have to screw over all my Mac users and require that they specify the application by typing in the path....and I'll have to figure out a way to execute an .app application.

 -- call me annoyed.
I opened a bug for nsIFilePicker.filterApps not handling non-app-bundles: bug 617515.

I'm essentially doing this to work around this bug:

/usr/bin/open -a <app-bundle> --args <arguments>
You need to log in before you can comment on or make changes to this bug.