Thoughts on Rails

Riding the Train of Thought

FreeBSD, Wine, IrfanView and Python

with 7 comments

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:


Written by hiway

January 21, 2007 at 9:39 pm

Posted in computers, python, software

7 Responses

Subscribe to comments with RSS.

  1. Is it possible to have the python program for download as file instead of copy, paste the code manually? Since python is strict with respect to indentation, copy, pasting may introduce errors.


    February 10, 2007 at 11:10 am

  2. Hi Shantanu, Thank you for bringing it to my notice… I have made the changes now. (yes, I should had realized it earlier!!)


    February 10, 2007 at 11:37 am

  3. […] first tried Irfanview, but I ran into the same issues as described here. After creating /home/richard/wine and putting mfc42.dll there with installation binaries for […]

  4. it works! Thanks!


    November 29, 2007 at 3:00 am

  5. @ K> : I’m glad this was useful to you! Thanks!


    November 29, 2007 at 11:52 am

  6. Hm, good for some windows software, unfortunatelly I nedd to use Microcal’s Origin (scientific software). It is a problematic software. It needs full path to the file, e.g. I have got in my home directory Origin’s project file:
    so I have to call Origin such a way:
    wine “C:\Program Files\OriginLab\OriginPro75\origin75.exe” “c:\windows\profiles\K\My Documents\project.opj”
    So I need to change the line of your script
    ” command = “wine \”” + associationMap[extension] + “\” ” + argumentList”
    in such a way the full path of the “project.opj” is added before argumentList. Can you please help me?


    November 29, 2007 at 5:09 pm

  7. @K> I havent coded in a few eras, and I’m not sure right now how I can help you out… but you might want to take this up to Python mailing list for some answers. Thanks for stopping by!



    December 3, 2007 at 1:35 am

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: