Need help with mime types & file associations



Nautilus Guri,

First, the caveats: I REALLY REALLY tried to figure this out myself, and found lots of thoroughly unhelpful hints on the web. I tried to look in the Gnome FAQ Wiki, but the web server said "permission denied", and I tried to search the archive of this mailing list, but that is broken too. If there is a better place to post this question, please let me know.

Problem Summary:

I am trying to configure an installer for my software, such that when the user tries to open a file with a particular extension, my program runs and is given that file as it's argument. (On Windows, I do this through a bunch of cryptic registry entries; on the Mac, I put some voodoo into an Info.plist file.)

Details:

1. My file format is really ZIP/JAR with a different extension, just like OpenOffice docs. 2. I need this to work with Sun JDS, which uses some version of Gnome and version 2.6.0 of Nautilus. (I don't know how to find out what version of Gnome is running.) 3. The desktop is ABSOLUTELY CONVINCED that my files are mime type application/zip 4. I'm very comfortable with Unix, dating back decades, but I have no experience whatsoever with modern Unix GUIs

What I think I know:

A) I need to convince the desktop that files ending in .mesonjar are mime type application/x-meson B) I need to convince the desktop to open application/x-meson files using my program

I'm mostly focused on A, since B seems to be pretty well documented (.desktop files seem to be the key), and I have to get A done before I can start to think about getting B right.

I read the man page on mime magic, which says that file sniffing is going to take priority over anything else I do. That looked bad until I looked at the magic file, and found the line for ZIP is commented out because it would keep StarOffice from recognizing its own files (according to a comment). This does leave me quite mystified as to how it knows my files are really ZIPs... is there something else that does the same thing as /etc/gnome-vfs-mime-magic?

There is a lot of conflicting documentation about how to put more mime types into the system, but nothing I try seems to have any effect. I think the system may have cached its conclusion that my .mesonjar files are ZIPs someplace, but I cannot figure out how to clear/refresh that cache. (I found documentation of a command called "update-desktop-database" but there is no such program on my test system.)

My concise question:

How do I convince my system that files ending in .mesonjar are mime type application/x-meson, even though they are really just renamed ZIP files?

-Joshua




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]