Hi,
I discovered only recently a problem which is probably quite prevalent, but I could not find the answer on the web.
Example: I want to configure Mozilla for opening .DOC files with the free Word Viewer that can be downloaded at http://www.microsoft.com. To do so I go to Edit -> Preferences -> Navigator -> "Helper Applications" and create a new MIME-Type "application/msword", extensions "doc dot" and tell the beast to open such files with /home/cbritz/.wine/drive_c/Programme/Microsoft Office/WORDVIEW.EXE (I have configured binfmt support, so I can call the EXE directly)
Expected behaviour: The viewer program starts, opens the doc file and displays it.
What happens: The viewer program starts and does not open any file. I must manually select Z:\tmp\Example.doc from the application.
Next try from command line: .wine/drive_c/Programme/Microsoft\ Office/WORDVIEW.EXE /tmp/Example.doc - Again the doc file doesn't open.
It DOES WORK when I manually translate the path name to: .wine/drive_c/Programme/Microsoft\ Office/WORDVIEW.EXE Z:\tmp\Example.doc first.
I expected naively that wine automatically translates the Unix scheme to it's own convention but this doesn's seem to be true.
Is it possible to instruct wine to translate the path string before it passes it to the windows binary? If not, is there a workaround to do that trick?
One solution would probably be to write a wrapper script that translates the path name before it is passed to wine. One discussion board entry I found indicates the CrossOver plugin does it that way.
I might even volunteer for trying to write a patch to wine if someone could tell me where to start to look at in the code ;)
But probably the solution is already out there and I just don't see it. Any help would be much appreciated!
Regards Christian
One solution would probably be to write a wrapper script that translates the path name before it is passed to wine. One discussion board entry I found indicates the CrossOver plugin does it that way.
Try this script:
#!/bin/bash document=`winepath -l "$1"` exec wine start.exe "$document"
If the word viewer installed the .doc file format in the wine registry you can call winestart /some/unix/path/file.doc and wine will start the asociated application automatically.
I've also written a small C program which scans the registry and creates .desktop files for each mime type found. I've sent a first alpha version to this list late June. With these .desktop files in place you can just click on the files in Konqueror or (I think so, but didn't test) the Gnome Equivalent and they will open. It's far away from beeing mature, but you can give it a try. I don't think that these .desktop files directly, but theres a kstart program which allows you to open any file KDE knows, and this works from literally any application.
Stefan
Dear Stefan,
Stefan Dösinger schrieb:
Try this script:
#!/bin/bash document=`winepath -l "$1"` exec wine start.exe "$document"
Marvellous! This is exactly the solution I need. :-) Maybe I should have been able to guess better what the "path" in winepath actually stands for... ;-)
If the word viewer installed the .doc file format in the wine registry you can call winestart /some/unix/path/file.doc and wine will start the asociated application automatically.
Yes, this works without any problems so far (using the Office 97 versions of the Word-, Excel- and PowerPoint viewers, they seem to be most compatible), even with Mozilla! I stored your little script under the name /usr/local/bin/winestart and selected that in the MIME options.
Now it feels 100% native to click on the "FUD" documents on www.microsoft.com! ;-)
I've also written a small C program which scans the registry and creates .desktop files for each mime type found. I've sent a first alpha version to this list late June. With these .desktop files in place you can just click on the files in Konqueror or (I think so, but didn't test) the Gnome Equivalent and they will open.
This sounds interesting to me. I will be pleased to test your program with Nautilus (the Gnome equivalent to Konqueror). I will search for your submission on the ML archives, if you have a newer version please tell me how to get it.
It's far away from beeing mature, but you can give it a try.
I will! :^)
I don't think that these .desktop files directly, but theres a kstart program which allows you to open any file KDE knows, and this works from literally any application.
I didn't get this sentence.
Thank you very much, Christian
Christian Britz wrote:
Stefan Dösinger wrote:
I've also written a small C program which scans the registry and creates .desktop files for each mime type found. I've sent a first alpha version to this list late June. With these .desktop files in place you can just click on the files in Konqueror or (I think so, but didn't test) the Gnome Equivalent and they will open.
This sounds interesting to me. I will be pleased to test your program with Nautilus (the Gnome equivalent to Konqueror). I will search for your submission on the ML archives, if you have a newer version please tell me how to get it.
Compiled and works fine with KDE (didn't have to change the directory permission as you wrote).
I didn't figure out how to use these .desktop files with gnome but that is not so important because you can easily adjust the mime type settings manually ("open with" -> winestart in file properties).
Regards Christian
This sounds interesting to me. I will be pleased to test your program with Nautilus (the Gnome equivalent to Konqueror). I will search for your submission on the ML archives, if you have a newer version please tell me how to get it.
Compiled and works fine with KDE (didn't have to change the directory permission as you wrote).
Good! If I find the time I'll try to improve it(Icons, Names, Stability, better searching the registry)
I didn't figure out how to use these .desktop files with gnome but that is not so important because you can easily adjust the mime type settings manually ("open with" -> winestart in file properties).
I don't use gnome, so I can't help you here :-( But AFAIR the .desktop files are slightly outdated and both KDE and gnome support a new freedesktop.org format. Maybe I should do some Investigation ans switch to this format.
I don't think that these .desktop files directly, but theres a kstart
program
which allows you to open any file KDE knows, and this works from literally any application.
I didn't get this sentence.
What I meant with this was, that KDE offers a 'kdestart' program. This program is similar to winestart. It searches the KDE mime database and starts the ascociated application. This can be used to asociate all unknown Mimetypes in Mozilla and other applications, so if Mozilla doesn't know the Mime type, it automatically asks KDE for help. It can be used in wine too. I've seen the oposite of winestart somewhere on this list which allows Windows Applications is wine to start native Linux apps transparently. So you can click on an OpenOffice Document in Internet Explorer and the Linux OpenOffice.Org will start and load the Document.
With a little work all this could improve the Desktop Integration of Wine a lot :-)
Stefan