FreeBSD, Wine, IrfanView and Python
Wine support in FreeBSD isn’t exactly as fine as it is in Linux… or so I hear. Maybe they are right – because I wasn’t able to run Picasa2, neither was I able to run the latest version of Winamp (even without themodern skin). The fun part was that the installations go super smooth… but the applications don’t run at all.
Then I decided to try a small application, one that I was using everyday when I was on Windows – IrfanView 3.99. The shock came when the installer refused to work! Apparently one dll file, the mfc42.dll was not found on the (wine) system. Getting the file wasn’t painful. [ search ] But the program kept getting creative with the error messages.
Finally I decided to try installing version 3.95 of the program and it worked!
Now I had a working IrfanView, but it was still not the default application for image files. So I tried setting it in Control Centre/ Open With in KDE. Nothing seemed to work.
Finally I came across a discussion where it became apparent that IrfanView cannot handle UNIX style forwad slashes in the filename. The solution was to write a script that changes the slashes to windows-style backslashes and then calls IrfanView.
So I wrote a small script that should make life easy for me. It converts the slashes and calls appropriate program via wine for a given file extension.
Now all I have to do is install the Windows programs into wine, update my script to associate the programs with extensions and point KDE to the script which automatically calls the right application.
Somewhat redundant, but I think it serves the purpose for now. I’m looking for a way to find out the proper associations from wine itself and not have to maintain a list of file handlers.
Here’s the code: launchWineProgram.py