Wine Registry

From Wine-Wiki.org

Contents

Information

The Wine registry has been constantly worked on and is well on the way to replacing the config file. In June 2005 Winecfg, was activated and now saves changes to the registry. Dimi Paun maintains a list of where you can now set different options for Wine, and the scope they have here http://winehq.org/site/status_options

There are four human readable files that are used to store registry information:

  • system.reg
    This file contains HKEY_LOCAL_MACHINE.
  • user.reg
    This file contains HKEY_CURRENT_USER.
  • userdef.reg
    This file contains HKEY_USERS\.Default (i.e. the default user settings).
  • wine.userreg
    Wine saves HKEY_USERS to this file (both current and default user), but does not load from it, unless userdef.reg is missing.

As all of these files are text files, unlike Windows, you can actually use an ordinary text editor on them if you want (but do make sure you don't have Wine running when modifying them, otherwise your changes will be discarded).

In addition to these files, Wine can also optionally load from global registry files residing in the same directory as the global wine.conf (i.e. /usr/local/etc if you compiled from source). These are:

  • wine.systemreg
    Contains HKEY_LOCAL_MACHINE.
  • wine.userreg
    Contains HKEY_USERS.

Currently the deprecated config file will still affect some settings. [Update] The config file has been competely deprecated.


Further Reading

The Registry Settings

Windows Version

Some applications work only with version=win98, and other applications work only with version=win2k. If an application won't start and pops up a message like 'This program requires Windows 2000/XP' then you may try to change this setting to get this program to work.

Wine Dll Overrides

You can use winecfg to save settings to the registry or WINEDLLOVERRIDES from the command line.

Command line example: WINEDLLOVERRIDES="comctl32=n;commctrl=n" wine foo.exe

Following native DLLs can't be used in Wine: ntdll.dll, gdi32.dll, kernel32.dll, advapi32.dll, winsock32.dll, and some others. Many DLLs from Windows XP don't work either. Use their Windows 98 equivalents or builtin DLLs instead.

For more information see the environment variable "WINEDLLOVERRIDES" in The Wine Man Pages

A user queried the use of this expression [Apr 06]:

"*"="native, builtin"

Does the "*" mean that if the driver, dll, exe in question is not listed in the DllOverrides section, that it defaults to using the native version of the file and, if not available, then tries to find and run a builtin version?

M. McCormack:"*" no longer does anything, and should be removed from registries. It's original intent was to force using native dlls over builtin dlls whenever found. It encouraged people to copy all the dlls from a windows install into their .wine, and was therefore removed.

The user queried further: if the file with the * in front of it exists, what would be Wine's behavior towards it. What I mean is, what does the * in the file name mean to Wine? Is it just a standard wildcard to match many files to one entry?

A. Julliard: The wildcard means that it matches that file in any directory. The same entry without wildcard would match only when loading from the system directory. wine archive

Fonts

Truetype Fonts

Here is the homepage for corefonts: http://corefonts.sourceforge.net/

Apparently these are the MS fonts (Andale Mono,Arial, Comic Sans MS, courier, Georgia, Impact, Times New Roman, Trebuchet, and Verdana), which are allowed to be redistributed unaltered, according to the EULA and FAQ linked to on the page, so the maintainer has done so. These can be installed via Portage, for Gentoo users, but this package is available via all (or most) distribution repositories - Google search for corefonts. Debian even has an msttcorefonts package in its 'contrib' section (stable, testing, and unstable).

The corefonts homepage makes RPMs, the original .exe files and cabextract available. Some distributions, such as SuSE, actually offer to install the MS core fonts unrepackaged (directly from the Microsoft site, I believe) via YaST. You may have to accept a licence for each individual font and it is often a slow process. So it's nice to have the *.exe files available from somewhere else, as well as the RPM.

The standard location for fonts under X.org is in /usr/share/fonts, but of course other users' locations may be different. If still using XFree86, the fonts may be in /usr/lib/X11/fonts, or /usr/X11R6/lib/X11/fonts/, and any given distro may have a custom location over and above that. However, once the corefonts are installed, a simple locate arial.ttf should indicate the path for these fonts. External True Type fonts are listed in the Wine Registry

HKEY_LOCAL_MACHINE=>Software=>Wine=>Fonts=>External Fonts

Apparently Wine or winecfg scans your system for True Type fonts and registers/lists what it finds, all by itself.

Forum Discussions

Wine's Registry format

A Programmer noted [Jun 05]:Wine Archive Wine loads the entire registry when it first runs, which can get become a waste - even if it's going to be swapped off anyway [...]It's also not the fastest method of input and especially output to the registry. [...and then suggested] Using a small helper app to sync our plain-text registry files into a db format would let us maintain a human-readable format of our registry, while also reducing the overhead required by the current registry format.[...] - It would also provide us with a quicker and easier way to search through the registry - so we could finally implement the Find feature in wine's regedit without much effort ( Not that it couldn't be done as is, but things would definitely be easier ).


A. Julliard: Actually the current method is probably the fastest for everything except the initial read. Admittedly it's not very elegant, but it's simple and allows us to store everything in text format. So I'm not at all convinced that using a real database would be worth the trouble.

D. Lambert: Samba already uses something called 'TDB', and it's been suggested that the two projects could share a case - insensitive - filename layer based on it; Could you look into using that?

K. Porter: Today's Samba announcement includes something about the ability to handle NT registry files: <http://us2.samba.org/samba/ftp/pre/WHATSNEW-3-0-20pre1.txt>

J. Liggart [Jun 05]: Have you thought about using XML as a potential format? Since the registry is a non-relational tree database, this seems to fit quite well. Plus, there's a few libraries that would do the dirty work for us (libxml, expat, many others, name your pick). It could even be possible to modularize the registry using technologies like XInclude or XLink.

M. Fuchs: the tree format would match. But this would not really make things better. You would also have to read the registry at once at startup time. The best solution would be to use native Windows registry format. This way you could use real Windows registry files, and can read and update registry piecewise. It's organized like a little file system - or database if you want to see it this way. It's not documented. But you could have a look at the ReactOS implementation, which claimes to be compatible to NT4. Win Archive

B. DeMorrow: [...]I'm really not convinced that we need to be compatible with Windows' registry file format at that level. . . That would only benefit applications that don't use the Win32API to access the registry - and as far as I know, Windows doesn't allow you to access the registry like that, so there shouldn't be any applications that would benefit from that. . .

S. Shemesh: How about an application that carries a binary registry hive around, and uses "LoadHive" to merge it (temporarily) into the registry? How about deploying Wine in such a way that it uses the existing user profile, user.dat and all? User.dat is a registry file, that goes through load hive. The way I see the ultimate outcome, Wine should have "Registry providers". These would allow it to use several different registry back ends. The default one would probably be the one used today, but this way we could plug in an SQL back end if needed, as well as a Windows compatible one, if needed.

J. Schmied commented that: Wine had support for reading win2000 registry files once. It was dropped some time ago. I had implemented it around 1999/2000.Have a look in the CVS.

[The discussion turned to implementing the Find function for the registry]Wine Archive

Current Status

[...] this was a long time comming. Glad to see we're within the deadlines :) Brian [Vincent], now we can update the User Guide too, and get the stuff you wrote some time ago into the official docs. Wine Archive

Feel free to add missed and, or further changes

Tips and Tricks

Clipboard

As Segin noted: There are two clipboards [...] select some text in Wine, and middle click in a Xterm, nothing happens! Go back to the Windows app, tell it to copy the text, and try to paste it into the xterm, nothing again! (I think it's a bug IMHO)

P.Krylov: You need to set the Wine registry entry X11 Driver/UsePrimarySelection to 'Y'. I submitted a patch for Winecfg to do it, but it wasn't accepted and it was a long time ago... wine archive

Importing a Windows .reg File

B. Vincent: An app I have uses the registry as a massive data store. There are literally thousands of keys and values sitting in there. It would be nice to export a small branch of the registry and just import that into Wine.

A. Hanulla: If I remember correctly, [...] the following command is enough:

$ regedit file.reg

R. Shearman: This doesn't work for Windows NT .reg files though, as they are generated in Unicode format by default. It shouldn't require too many changes for regedit to work with Unicode files. The changes to the profile functions in kernel32 to work with Unicode were simple enough.


Graphics

GLSL

enabling GLSL: (HKCU/Software/Wine/Direct3D/UseGLSL = enabled) wine archive

texture repacking

repacking can be quite CPU intensive, and warhammer 40k is the only game so far that needs nonpower2 texture repacking so it's turned off by default but can be turned on via the following registry key:

HKEY_CURRENT_USER/Software/Wine/Direct3D Nonpower2Mode [repack]

Anti-aliasing

A user said [July 05]: I want to turn off Wine Anti-aliasing. I was able to do it in the config file, but now I don't know. 'winecfg' doesn't have any such setting. Can it be turned off in the registry ? If so what is the setting ? Wine Archive

H. Davies: Add the values

"ClientSideAntiAliasWithRender"="N"
"ClientSideAntiAliasWithCore"="N"

to the key HKCU\Software\Wine\X11 Driver


Screen Resolution

Stefan Dösinger [Dec 05]: Cedega changes the screen resolution, but desktop dimensions are unchanged. That's a Xrandr issue: Wine uses Xrandr to change the screen resolution: Both the virtual Desktop and the Screen resolution are changed. Cedega only changes the Screen resolution just as if you typed Ctrl + alt + "+". The reason why Wine so is a mouse locking issue: dinput.dll fails to lock the mouse inside the Wine window often, and if the Desktop is bigger than the screen, one can accidentally move the mouse outside the game window. The solution to this one is to fix dinput and avoid the use of Xrandr.

There's a registy key to force the cedega behavior I think it's HKCU\Software\Wine\X11 Driver\UseXrandr, but I am not sure. wine archive

Forum Comments

HKCU/Sofware/Wine/AppDefaults/radmin.exe/X11 Driver/Desktop registry key to "1024x768" doesn't work.

[wine-users Apr 06] It's no longer possible to set that per-application in the registry. See http://winehq.org/?issue=310#Major%20Changes%20to%20Desktop%20Mode

Configuring Sound

Occasionally when your sound has some bugs (ARTs seems to be regularly mentioned), you cannot successfully run winecfg to set up sound for Wine. This has been noticed and worked on several times, with a measure of success. However, you can easily work around this problem using the registry editor. Dont be too fearful of working with the registry. Make a backup if needed and lets dive in and get our feet wet. (Dont forget that wine can be 'reinstalled' rather quickly by deleting all the files in .wine and typing winecfg, but just as a reminder...make sure to backup any files you need first.)

  • [Nov 05] You can disable the default sound driver. R. Klazes: [using regedit locate this key] To disable enter change "oss" to ""
[Software\\Wine\\Drivers] 1121776151
"Audio"="oss"
  • [Dec 05] R. Rief: HKCU/Software/wine/Drivers/Audio. [is the driver for audio] [...He then said he had a patch which selected] OSS [as] the default if there is no registry key. wine archive

[Anon Jan 06] This appears to be case sensitive. I use upper case for OSS.

  • Correct regedit path is HKEY_CURRENT_USER/Software/Wine/Drivers

[Anon Apr 06]: This Registry key didnt exist for me, and winecfg always crashed every time I clicked on Audio. The wordaround for me was to run regedit at the command line, locate HKEY_CURRENT_USER/Software/Wine and select the folder called Wine. Right click, New, Key - and create a folder called Drivers. Right click, New, String and Create a string called Audio, leaving this blank. Only then could i run winecfg to configure sound.

Ports

H. Bostick explained Permission difficulties can prevent access to the ports[Oct 05] : [one users settings for] com ports [were] only available to root, and Wine is not intended to be run by root (and in fact should not be run by root). On my system, /dev/ttyS1 is a symlink to /dev/tts/1 which is owned by root and the tty group. Is your user a member of all such groups that might own the serial ports (tty, serial, com, dialup or dialout, etc)? Please check this (easiest would be to look in /dev and see what group exactly owns the ports and add yourself to it), and after doing so, remove (delete, rm -rf) the /.wine directory in /root (root's HOME folder), as root having a Wine configuration will mess up your user configuration, then try your program again. [wine archive]


Serial Com Port

A programmer found a program that: did not "see" the COM ports until I added the following entries into the registry:

[HKEY_LOCAL_MACHINE\hardware\devicemap\serialcomm]
"COM2"="COM2"
"COM1"="COM1"

[Nov 05] One user reported: I have found that while many apps will happily Just Work, some apps need the following entries in system.reg: wine archive

[HARDWARE\\DEVICEMAP\\SERIALCOMM] 1131331688
"COM1"="COM1"
"COM2"="COM2"

Parallel Port

Direct access to the parallel port is necessary for programs such as EPROM burners or ones that use dongles.

This is very slow under wine and puts heavy load on the CPU, which is a known bug 3845 .

There are two ways:

1) The correct and safe way (which works with every parallel port):

Add a device mapping by adding the registry key "Software\Wine\VDM\ppdev". Then add a string entry for every port you want to use:

"378" with value "/dev/parport0" for LPT1,
"278" with value "/dev/parport1" for LPT2,
...

Not all distributions provide the /dev/parport? entries by default, since they're not needed for normal printing. You can create /dev/parport0 with mknod /dev/parport0 c 99 0

Make sure that you have the ppdev driver in your kernel.

Now create a group for all users that should be allowed to access the parallel port and give /dev/parport? to it or just set the rights on /dev/parport? to 777.

2) Quick and dirty (which will only works with parallel ports that are located at the I/O locations the IBM PC uses for parallel ports):

Create the registry key "Software\Wine\VDM\Ports" and add string entries

"read" = "0x779,0x379,0x280-0x2a0"
"write" = "0x779,0x379,0x280-0x2a0"

Run wine as root and you can use LPT1 and LPT2. [Ed. Note running wine as root is not recommended unless you are an expert user of wine.]

[Nov 05] a user posted: Try to set the windows version [as 2000 and then] add the following registry keys [HKEY_USERS\S-1-5-4\Software\Wine\VDM\Ports] "read"="0x278-0x27f,0x378-0x37f" "write"="0x278-0x27f,0x378-0x37f"

and run wine as root. That's how I made an eprom burner that has to do direct parallel port access work. wine archive

Scanners may give messages similar to what was described by one man:

fixme:vxd:VXD_Open Unknown/unsupported VxD L"plkscnr.vxd". Try setting Windows version to 'nt40' or 'win31'.
fixme:vxd:VXD_Open Unknown/unsupported VxD L"scandrv.vxd". Try setting Windows version to 'nt40' or 'win31'.

many vxd drivers dont currently work on Wine due to design reasons. This can be avoided by changing the version of Windows using winecfg

P. Krause: It could be that you application tries to use the vxd files when running on Windows 2000, but do the I/O itself when running under Windows 98. wine archive

Further Reading

ODBC

A user posted: I have in an existing windows installation a large number of 'system DSN data sources' which I would like to have under wine. Is it possible to import these?

Another posted: The system DSN's are stored in the windows registry and can be exported using "regedit". Run regedit under windows and locate

HKEY_LOCAL_MACHINE/SOFTWARE/ODBC

right-click on the ODBC node to export its contents to a file. The result is a text file in a very similar format to the wine registry file and I believe it can be imported using the wine version of "regedit". Or you can just paste the contents into the (text based) wine registry file whilst changing the headers to match the wine registry header's style. wine archive

Time

During a discussion about where to store the information M.McCormack offered: TimeZones are stored in what Wine called the %CurrentVersion% key. It's easy enough to change the program that generates the data to put them in Windows NT\CurrentVersion if that's what is decided to be correct.

A. Jullard: In theory it should be under both, but for now we probably should put it under Windows NT only, until we find an app that depends on the Win9x location.

Drives

A user reported that for a cdrom:

HKLM/Software/Wine/drives (with name "D:", type "REG_SZ", and data "cdrom").

Drive Label and Serial settings seems to be unsupported.

Path

A user asked where to set the path for Wine. J. Earnst [Oct 05] Use regedit and edit the key at wine archive:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment

Another user found his software tried to add the path to autoexec.bat [Dec 05]: the GTK dll path was in autoexec.bat, but it seems wine doesn't take care about it, so i added the dll path to the wine path in system.reg:

PATH"="c:\\windows\\system;c:\\windows;c:\\Program Files\\FichiersCommuns\\GTK\\2.0\\bin"

Networking

Netbios

J. Lang: [April 06] [For] NetBIOS [...] the registry has to be set up [...] You have to set up the WINS servers, if you use them. This isn't documented except in the code (dlls/netapi32/nbt.c.) It's marked with the usual @@ Wine registry key tag. There are some other things you can tweak if necessary. I suppose this could go into winecfg. It can't go into wine.inf, because we can't guess correct values. .[...] Broadcast name resolution works without any setup, and WINS can be added by those that use it. (That should probably be documented someplace.) wine archive

DNS NameServer

R. Klazes [Nov 05]: Lots, if not most, of applications would use the winsock function gethostbyname, which is handled by the Unix gethostbyname function. That works fine ;)

If I add the string registry value

HKLM\System\CurrentControlset\Services\Tcpip\Parameters\DhcpNameServer

and fill it the IP address of a name server it works here. A NT4 nslookup.exe worked immediately, a Win2K version only if I did set the version to NT4. wine archive


Proxy Server

R. Holt [Dec 05] was trying to use wine with some M$ software from behind [a] company firewall: All outgoing connections need to go through our proxy server.[...] To get it to work, I edited my ~/.wine/user.reg and added in the section titled:

[Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings] 1133455573
"ProxyEnable"=dword:00000001
"ProxyServer"="www-proxy.[redacted].org:8080"

A poster tried:

ftp_proxy=ftp://[redacted.bla.com.port]
http_proxy=http://proxy...
https_proxy=http://proxy... no_proxy='localhost, [redacted]'

Any ideas why it doesn't start the download?

M. Hearn:Wine doesn't currently support these environment variables. I sent a patch to add support for $http_proxy so this would work but it hasn't been checked in yet. Until Alexandre makes a decision you must manually fiddle with the registry to set the proxy settings. wine archive

The user then reported I added below

[Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings]
147164925
@=""

[The following]

"ProxyEnable"=dword:00000001
"ProxyServer"="proxy.[redacted:port]"

in the user.reg and it started and completed the download. But after this, iexplore.exe just blinked and closed again

Internet Explorer

Faking it..

P. Vriens [Jul 06 regarding MSN Messenger] if you add \HKLM\SOFTWARE\Microsoft\Internet Explorer\Version (REG_SZ with 6.0.2900.2180) it installs.

D. Kegel: So many apps need this that I use a shell script to create it: http://kegel.com/wine/fakeie.sh.txt (One of these days I'll make that script use regedit...) wine archive

Links

Wine Links