August 2007 - Posts

More experiments about StarDict 3

After encountering the weird fail-to-start problem of StarDict 3, I did a few more experiments, the results were quite interesting.

Basically, I used two methods to start StarDict: one way is to use a shortcut create by the StarDict installer; the other is to go to "C:\Program Files\StarDict" and run stardict.exe by double-clicking it. The essential difference of the two is that the former starts in "C:\Program Files\Common Files\GTK\2.0\bin" (as can be seen from the properties of the shortcut), while the latter "C:\Program Files\StarDict".

If I start StarDict by the first method, no mater how many times I close it and restart it (by the same method), it works well. However, if I try the second method, no mater how many success or fail starts previously tested, it will no longer be able to start (using either method), well, unless I log off and then re-login (or restart the computer). There might be other ways that could fix this, e.g., renaming the directory as I did last night. Anyway, trying to open stardict.exe directly from its own directory is worse than unsuccessful, it's somewhat poisonous -- it causes the original working method to fail as well. 

I do know how this happens, but I guess it might have something to do with the dynamic loaded libraries StarDict uses. Given the fact the the first approach uses the GTK bin directory, I would further guess the GTK+ DLLs (or the way StarDict uses them) might cause the problem. But why does it has to start from that GTK bin directory, when once we try to start it somewhere else it would not start again even from the GTK bin directory? Perhaps StarDict would look for some files and some flag is issued when it fails to find them, and perhaps Windows preserves such a flag until something special happen. Not sure if the OS could detect flaws in the program (such as overflow) and stop allowing it being run (for protection of the system). When the directory is renamed, it might be consider as another program so it could work again. But this does not explain why when the file itself is renamed it would not work, nor can it explain why once the directory name is renamed, we can start it directly without going back to the GTK bin directory. Well, it looks like a DLL conflit problem.  Maybe I should use the Process Monitor (which, BTW, just released a new version v1.22 today) to check what exactly StarDict has done to the system when it starts.

posted by wenyang with 0 Comments

StarDict 3.0, and a fix for the fail-to-start problem on Windows

StarDict is a cross-platform (supposed to works on both Linux and Windows ) international dictionary software licensed under GPL.
It is primarily developed by Hu Zheng.

Having heard about it for many times, I gave it a try today. Unfortunately, after I installed it on Windows, I just realized it did not work on my machine. Initially I thought it was the GTK+ problem. But I had the latest GTK+ (2.10.13) and GIMP 2.2 worked fine. Then I tried several other things, and was eventually happy to find out that it would work if the directory name is NOT StarDict! I tried Star, StarD, StarDi, StarDic, ... , all worked well. Finally, I renamed the directory as StarDict3. (For one moment I was thinking whether it had any limit on the path length, and that's why I tried short names first. But it turned out a longer directory name would also work.) What a weird problem!

I also tried to rename the executable from stardict.exe to something else. But that (at least by itself) did not work.

Not sure why this is the case. I have no time to look at the source code yet. Anyway, the renaming hack works like magic.
posted by wenyang with 1 Comments

Xming: free X Window server for Windows

The X-Win32 license received from MIT expired last week. So I installed Xming, a free replacement. It is licensed under GNU GPLv2, so technically speaking we should be able to get the source code. Unfortunately, the source code is not distributed in a download-friendly way, e.g., packed into a single file. Indeed, we can find something on http://www.straightrunning.com/Xming/, but it could be difficult to download all of them (without using a suitable tool), and I did not attemp to get it.  Also what's available there seems to be of the latest version. Not sure how to obtain the codes for the previous releases.

Despite all the issues with the source code, it works well on my laptop, as long as the Xming-fonts package is also installed.

posted by wenyang with 0 Comments