Tips for shipping VB6 or Visual C++ Apps on Linux
Which versions of Linux should I support?
Most vendors test with and officially support only a few versions of Linux.
Some popular ones at the moment are
It is possible with care to ship a single version of
Wine that runs on all these versions of Linux.
This will become easier as the
LSB (Linux Standard Base)
matures; at some point in the future, it will be possible to build
Wine as an LSB package. (At the moment this isn't possible because
the LSB
doesn't yet support sound or OpenGL.)
That's a lot of choices. What do I start with?
Just pick one distribution; you can address the other distributions later.
I recommend starting with Ubuntu.
Should I bundle Wine with my product, or just let the user install the Windows version?
It's fairly easy to provide a single Linux installer that bundles your
own tested version of Wine with your Windows installer, and you
should do this because it makes installation and support easier.
At the same time, you should also let motivated customers
just use your Windows installer with their own copy of Wine,
because they will expect to be able to do this, and because
it will let them use newer and better versions of Wine.
Do I need to change my installer?
No, most installers should run fine under Wine. However, you should
probably make sure your installer bundles the Visual C and Visual Basic
redistributable runtime libraries. This lets your app run on older
versions of Windows that don't bundle those libraries, and also makes
it easier to install your app on Linux.
How do I install Wine?
First, be aware that Wine is rapidly progressing; you probably want to
test with a version that is no more than a month or so old.
(Who wants to report a bug, only to find that it's already been fixed?)
The easiest way to install Wine is to download precompiled packages
from winehq.org
and install them using your wine distribution's package manager.
This usually installs Wine as /usr/bin/wine.
If you're comfortable with Make and gcc, you may wish to build your own copy
of Wine from sources; it's fairly easy, and lets you try out fixes
and inspect the code. The source can be retrieved via CVS
as described at winehq.org/site/cvs.
By default, this installs Wine as /usr/local/bin/wine.
What about fonts? All the text looks poor.
Wine does not ship with commercial fonts for licensing reasons,
and the available free fonts are not yet as good.
If this causes problems for your application, installing
the Microsoft Core Web fonts are high-quality fonts will probably help.
They can be freely and legally downloaded from e.g.
corefonts.sf.net
and installed under Wine, but cannot be bundled with
your application. However, your Linux installer can check for these
fonts, and offer to install them if not found.
What about IE? Do my users need to install IE?
No. You should not require or encourage your users to install
IE. Although Internet Explorer does run under Wine,
your app should run without it. Wine includes its own implementation
of IWebBrowser based on Mozilla, and will download and install it
for the user if needed.
I've heard about something called Winetools. Do I need it?
No. Winetools is mainly useful for people who want to install
Internet Explorer. This is not something you want your customers to
have to do.
My installer fails with "import_dll Library MSVBVM60.DLL not found"!
Your installer requires but doesn't install the Visual Basic runtime libraries.
You or the end-user can work around this by installing them
(by running vbrun60.exe or vbrun60sp5.exe) before running your installer.
You should probably fix your installer to install the runtime libraries
(and to work properly on systems that don't include the vb runtimes yet!).
I want to try running with a native version of some DLL. How do I tell if it's being used?
First off, normally Wine prefers to use its own built-in
versions of core Windows DLLs, so it runs without using the DLLs
from C:\WINDOWS\SYSTEM or C:\WINDOWS\SYSTEM32. You can
override this by running the 'winecfg' program, clicking
on the Libaries tab, and adding the library in question to the
exceptions list; then copy the DLL to the appropriate folder
(often C:\WINDOWS\SYSTEM32).
To tell whether the new DLL is really being used, pass the WINEDEBUG=+dllfile
environment variable to Wine when you run your app, e.g.
$ WINEDEUBG=+loaddll wine path/to/my/app > log.txt 2>&1
Let's say you're interested in riched20.dll.
To look through log.txt for mentions of your DLL.
you would do
$ grep -i riched20.dll log.txt
If the DLL is loaded from Wine's built-in DLLs, you'll see
trace:loaddll:load_builtin_dll Loaded module L"c:\\windows\\system32\\riched20.dll" : builtin
Otherwise, if the DLL is being loaded from one of the system directories, you'll see
trace:loaddll:load_native_dll Loaded module L"C:\\windows\\system\\RICHED20.DLL" : native
which is what you wanted.
Are there any GUI test drivers that work with Wine?
I'm keeping a list of them at testsw.html.
At the moment, the only one I've verified works at least partially
with Wine is VistaTask.
I have yet to try WinRunner.
[Back to Shipping Your Windows Application for Linux using Wine]