Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
Relative paths in mimeTypes.rdf?
Posted by: Selanit
Date: December 29, 2003 07:38PM

Hello, everyone. I'm one of the project leads over at TheOpenCD (theopencd.org). In the next major update to our project, we're planning to use K-Meleon as the base for the CD browser utility, using some heavily customized menus, toolbars, and so on.

We've managed to teach K-Meleon to shellExecute arbitrary files by defining a new mime-type (application/launch, with the .lch extension) and writing a helper app that handles that mime-type. The helper app extracts the necessary command information from the .lch file, and then executes it. (You can see our helper app, bin and src, at http://www.chaingang.org/code/Launch/Launch.html).


Unfortunately, we've run into a problem. The NC:path line in mimeTypes.rdf expects an absolute path, eg NC:path="C:\Launch.exe". Unfortunately, this is going to be run from a CD, and we have no way of predicting in advance what drive letter the CD will have. We tried specifying a relative path (eg "..\..\..\..\Launch.exe", but we also tried forward-slashes, /) but that didn't work. A guy over on the Mozilla IRC channel suggested that mimeTypes.rdf will search the system $PATH for executables referred to without a path, but so far our experiments haven't provided any evidence for this behavior.

We've discussed copying the helper app and an appropriate profile into %temp%, but we'd really rather avoid writing to the user's hard drive if possible.

Can any of you suggest a way to resolve this problem? Keep in mind that our helper app, Launch.exe, is also responsible for launching K-Meleon itself when the disc auto-runs. We can modify Launch.exe to fiddle with settings and such, if that'll help.

Thanks for any advice you might have.

Will Martin
TheOpenCD.org

Options: ReplyQuote
Re: Relative paths in mimeTypes.rdf?
Posted by: Selanit
Date: December 29, 2003 08:04PM

Update: I just got an offer from Christian Biesinger (biesi) of a modified Mozilla 1.5 dll that will cause the program to check the program's own directory for helper apps. He also said that he plans to incorporate this behavior into future versions of Mozilla, probably starting with 1.7alpha.

This will probably resolve our problem. I'd still love to hear your comments, though.

Options: ReplyQuote
Re: Relative paths in mimeTypes.rdf?
Posted by: Andrew
Date: December 29, 2003 08:44PM

That's probably the best approach. We just use Mozilla bits for that kind of handling so short of us modifying the Mozilla code, we would normally look to the Mozilla coders to provide that level of customization.

Options: ReplyQuote
Re: Relative paths in mimeTypes.rdf?
Posted by: Selanit
Date: December 30, 2003 02:28AM

Well, biesi came through with that modified DLL, and it works. So looks like our problem is solved. We'll be sure to keep you people posted on our progress.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.