Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get absolute path of application from file mime type

23 views
Skip to first unread message

epplestun

unread,
Jun 22, 2012, 5:32:26 AM6/22/12
to
Hi,

I want to get application full path from specific MIME type with XPCOM
components, is posible?

I'm using MIMEService to get mimetype of file and I need to get the
application path who opens this file type.

Any ideas?

Thanks

Boris Zbarsky

unread,
Jun 22, 2012, 11:06:35 AM6/22/12
to
Use nsIMIMEService.getFromTypeAndExtension to get an nsIMIMEInfo.

Then look at its preferredApplicationHandler (which may be null), QI it
to nsILocalHandlerApp (which it may fail to do), and look at the
.executable nsIFile.

-Boris
0 new messages