Bug 82155 - [Widgets] EC: selecting executable in FileDialog answers .app directory
Summary: [Widgets] EC: selecting executable in FileDialog answers .app directory
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Felipe Heidrich CLA
URL:
Whiteboard:
Keywords: consistency
Depends on:
Blocks:
 
Reported: 2005-01-04 12:13 EST by Grant Gayed CLA
Modified: 2012-06-22 15:33 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grant Gayed CLA 2005-01-04 12:13:22 EST
- launch a FileDialog on OSX and select your eclipse executable, press OK
- the return value is <eclipseRootDir>/eclipse.app instead of 
<eclipseRootDir>/eclipse

I don't know if this is semantically correct on OSX, but it's a consistency 
problem because having the FileDialog answer a directory will cause problems 
for any client that's (correctly) assuming that the answer must represent a 
file.
Comment 1 Steve Northover CLA 2005-01-04 13:06:01 EST
FH to investigate.
Comment 2 Felipe Heidrich CLA 2005-01-04 16:34:39 EST
I don't know what is semantically correct on OSX and what is not.
Andre, can you shed some light in here ? Thank you
Comment 3 Grant Gayed CLA 2005-01-04 16:57:49 EST
The problem is that from the client's perspective, the answer should always 
represent a file, regardless of the platform.
Comment 4 Andre Weinand CLA 2005-01-05 10:36:49 EST
Yes, this is a tough problem.
I don't have a solution for this, but here are some factoids/thoughts:

- MacOS X applications are not necessarily represented by executable files only.
   An application with UI is typically represented as a "bundle", that is a folder containing
   a manifest and various other resources.

- "Bundles" cannot be launched by a Unix-style "exec"; launching requires either use of
   "LaunchServices" or the application name must be passed to /usr/bin/open
    and there is a third way:

- bundles contain a single executable file in Xxx.app/Contents/MacOS/ that can be used
   to launch an application with "exec", however the name of this file must be extracted from
   the Info.plist file (XML), that represents the manifest for the bundle. Applications lauched 
   this way behave slightly differently than applications launched via the official way.
   E.g., IIRC you can launch them more than once. So I'm not sure whether this "third" way is
   a viable solution.

- the native FileDialog can be configured to allow navigation inside bundles.
   SWT uses it this way. If bundle navigation is not enabled, an end user could select
   an application bundle (the Xxx.app directory), and it would look like a normal file.
   However the object returned from the native filedialog would still be a directory
   (which cannot be passed to "exec").

- Eclipse cannot deal with bundles at all because it assumes that an application is represented
   by a file that can be passed to "exec". This assumption is wrong on MacOS X.

   A better approach for Eclipse would be to provide a high level version of "exec" that knows how
   to deal with application bundles, i.e. to use /usr/bin/open to launch them.

   A workaround would be to make the SWT filedialog return the "real" executable contained
   inside the bundle (instead of the bundle directory). However, for this the filedialog
   would need to know upfront whether it is used to select an application. 
Comment 5 Felipe Heidrich CLA 2009-08-18 12:23:36 EDT
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
Comment 6 Silenio Quarti CLA 2012-06-22 15:33:02 EDT
Closing report, platform is discontinued.

Works on cocoa.