Running Wine
Written by &name-john-sheets; &email-john-sheets;How to run Wine
Wine is a very complicated piece of software with many ways to
adjust how it runs. With very few exceptions, you can
activate the same set of features through the configuration file as you can
with command-line parameters. In this chapter, we'll briefly
discuss these parameters, and match them up with their
corresponding configuration variables.
You can invoke the wine --help command to
get a listing of all Wine's command-line parameters:
Usage: ./wine [options] program_name [arguments]
Options:
--debugmsg name Turn debugging-messages on or off
--dll name Enable or disable built-in DLLs
--help,-h Show this help message
--version,-v Display the Wine version
You can specify as many options as you want, if any.
Typically, you will want to have your configuration file set
up with a sensible set of defaults; in this case, you can run
wine without explicitly listing any
options. In rare cases, you might want to override certain
parameters on the command line.
After the options, you should put the name of the file you
want wine to execute. If the executable is
in the Path parameter in the
configuration file, you can simply give the executable file
name. However, if the executable is not in
Path, you must give the full path to
the executable (in Windows format, not UNIX format!). For
example, given a Path of the following:
[wine]
"Path"="c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\"
You could run the file
c:\windows\system\foo.exe with:
$wine foo.exe
However, you would have to run the file
c:\myapps\foo.exe with this command:
$wine c:\\myapps\\foo.exe
(note the backslash-escaped "\" !)
If you want to run a console program (aka a CUI executable), use
wineconsole instead of wine
to start it. It will display the program in a separate Window
(this requires X11 to be run). If you don't, you'll still be able
to run your program directly in the Unix console where you started it,
but with very limited capacities (so your program might work,
but your mileage may vary). This shall be improved in the future.
Command-Line Options--debugmsg [channels]
Wine isn't perfect, and many Windows applications still
don't run without bugs under Wine (but then, a lot of programs
don't run without bugs under native Windows either!). To
make it easier for people to track down the causes behind
each bug, Wine provides a number of debug
channels that you can tap into.
Each debug channel, when activated, will trigger logging
messages to be displayed to the console where you invoked
wine. From there you can redirect the
messages to a file and examine it at your leisure. But be
forewarned! Some debug channels can generate incredible
volumes of log messages. Among the most prolific offenders
are relay which spits out a log
message every time a win32 function is called,
win which tracks windows message
passing, and of course all which is
an alias for every single debug channel that exists. For a
complex application, your debug logs can easily top 1 MB and
higher. A relay trace can often
generate more than 10 MB of log messages, depending on how
long you run the application. Logging does slow down Wine
quite a bit, so don't use --debugmsg
unless you really do want log files.
Within each debug channel, you can further specify a
message class, to filter out the
different severities of errors. The four message classes
are:
tracefixmewarnerr.
To turn on a debug channel, use the form
class+channel. To turn it off, use
class-channel. To list more than one
channel in the same --debugmsg
option, separate them with commas. For example, to request
warn class messages in the
heap debug channel, you could invoke
wine like this:
$wine --debugmsg warn+heap program_name
If you leave off the message class, wine
will display messages from all four classes for that channel:
$wine --debugmsg +heap program_name
If you wanted to see log messages for everything except the
relay channel, you might do something like this:
$wine --debugmsg +all,-relay program_name
Here is a master list of all the debug channels and classes
in Wine. More channels will be added to (or subtracted
from) later versions.
For more details about debug channels, check out the
The Wine Developer's Guide.
--dll
Specifies whether to load the builtin or the native (if
available) version of a DLL.
Example:
$wine --dll setupx=n foo.exe
See the DLL chapter for more details.
--help
Shows a small command line help page.
--version
Shows the Wine version string. Useful to verify your installation.
Setting Windows/DOS environment variables
Your program might require some environment variable to be set
properly in order to run successfully.
In this case you need to set this environment variable in the
Linux shell, since Wine will pass on the entire shell environment
variable settings to the Windows environment variable space.
Example for the bash shell (other shells may have a different syntax
!):
export MYENVIRONMENTVAR=myenvironmentvarsetting
This will make sure your Windows program can access the
MYENVIRONMENTVAR environment variable once you start your program
using Wine.
If you want to have MYENVIRONMENTVAR set permanently, then you can
place the setting into /etc/profile, or also ~/.bashrc in the case of
bash.