Difference between revisions of "Wine"

From ArchWiki
Jump to: navigation, search
(x86_64)
(Configuration)
Line 32: Line 32:
 
To create configuration files do
 
To create configuration files do
 
   winecfg
 
   winecfg
review the settings and click ok to save. The wine directory with config files resides in  
+
review the settings and click ok to save. Some options are not present in '''winecfg''', they are accessible in the Wine registry. To change the Wine registry via GUI:
 +
  regedit
 +
Also you can import/export text data into/from the Wine registry. In GUI do "File/Import registry file…" and "File/Export registry file…". In command line there is a bunch of commands, see:
 +
  regedit /?
 +
 
 +
The wine directory with config files resides in  
 
   ~/.wine
 
   ~/.wine
 
and by default C:\> will be mapped to
 
and by default C:\> will be mapped to
Line 61: Line 66:
 
Other TTF fonts you wish to install should go in $C_DRIVE/windows/fonts/ (where $C_DRIVE is usually ~/.wine/drive_c) for wine to recognize them.
 
Other TTF fonts you wish to install should go in $C_DRIVE/windows/fonts/ (where $C_DRIVE is usually ~/.wine/drive_c) for wine to recognize them.
  
If the fonts look somehow smeared, enter the .wine directory and create a file fontrender.txt with the content:
+
If the fonts look somehow smeared, Import the following text file into the Wine registry:
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
 
  "ClientSideWithRender"="N"
 
  "ClientSideWithRender"="N"
 
Add the key to your wine configuration by executing the following command:
 
regedit fontrender.txt
 
  
 
====Enabling font anti-aliasing====
 
====Enabling font anti-aliasing====
  
Create a file with a .reg (example: aa.reg) with the following content :
+
Import the following text file into the Wine registry:
  
 
  REGEDIT4
 
  REGEDIT4
Line 80: Line 82:
 
  "FontSmoothingOrientation"=dword:00000001
 
  "FontSmoothingOrientation"=dword:00000001
  
run
+
Possible values are:
regedit
+
* FontSmoothing:
and choose 
+
** 0 — anti-aliasing disabled;
File -> Import registry file...  
+
** 2 — anti-aliasing enabled;
 +
* when anti-aliasing enabled, FontSmoothingType:
 +
** 00000001 — grayscale;
 +
** 00000002 — subpixel (see [http://en.wikipedia.org/wiki/Subpixel_rendering subpixel rendering]);
 +
* when subpixel, FontSmoothingOrientation:
 +
** 00000000 — BGR;
 +
** 00000001 — RGB.
  
and select your .reg file. Anti-aliasing fonts will be after the conclusion of regedit, and run wine applications again.
+
Anti-aliasing fonts will be after the conclusion of regedit, and run wine applications again.
  
 
===Sub-Menu===
 
===Sub-Menu===

Revision as of 06:50, 6 July 2010

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

Wine is a translation layer (a program loader) capable of running Windows applications on GNU/Linux and other POSIX compatible operating systems. Windows programs running in Wine act as native programs would, running without the performance or memory usage penalties of an emulator, with a similar look and feel to other applications on your desktop.

Installation

i686

Wine is constantly updated and available in the [extra] repository:

pacman -S wine

x86_64

The 64 bit build of Wine isn't fully functional yet. However, it can be built by following the official Wine64 wiki page here. If you don't mind stuffing your PC with i686 libraries and binaries, then use one of the bin32-wine packages in the AUR: bin32-wine and bin32-wine-suse. bin32-wine is also available in the Arch-Games repo.

Important: If you have a nvidia-graphicscard, you'll need to do

pacman -S lib32-nvidia-utils

to use 3D-allocation! Or look here for other than the newest lib32-nvidia-utils version, if you use the nvidia-96xx driver version for example.

If you have still graphic problems with NVIDIA cards, you'll should try to install all lib32 packages by "pacman -S lib32". This fixes some issues.

Important: To get sound with alsa you need to install

pacman -S  lib32-alsa-lib

Archgames repos does for some weird reason not even mention it......

Configuration

To create configuration files do

 winecfg

review the settings and click ok to save. Some options are not present in winecfg, they are accessible in the Wine registry. To change the Wine registry via GUI:

 regedit

Also you can import/export text data into/from the Wine registry. In GUI do "File/Import registry file…" and "File/Export registry file…". In command line there is a bunch of commands, see:

 regedit /?

The wine directory with config files resides in

 ~/.wine

and by default C:\> will be mapped to

 ~/.wine/drive_c

Ok! This is the basic configuration. You can try to run something using:

 wine /path/to/something.exe

If you're having trouble getting DirectX apps to run properly, try adding the -opengl flag:

 wine /path/to/3d_game.exe -opengl

Sound

Note: This section may be outdated.

By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in winecfg. Alsa should work out of the box but is still glitchy & slow in some games, there exists a patch for this issue here:

http://kcat.strangesoft.net/wine_thread_prio.diff

but using oss and selecting winecfg -> Sound -> Hw acceleration -> Emulation will also fix the audio issues for you provided you are using the alsa oss emulation kernel modules. (Note: using the aoss utility does not solve the issue; you must load the snd-pcm-oss module.)

Fonts

  • If wine applications are not showing easily readable fonts, you may not have Microsoft's Truetype fonts installed. Luckily arch has a package for that.
pacman -S ttf-ms-fonts

After running such program, kill all wine servers and run winecfg; fonts should be legible now.

Other TTF fonts you wish to install should go in $C_DRIVE/windows/fonts/ (where $C_DRIVE is usually ~/.wine/drive_c) for wine to recognize them.

If the fonts look somehow smeared, Import the following text file into the Wine registry:

[HKEY_CURRENT_USER\Software\Wine\X11 Driver]
"ClientSideWithRender"="N"

Enabling font anti-aliasing

Import the following text file into the Wine registry:

REGEDIT4

[HKEY_CURRENT_USER\Control Panel\Desktop]
"FontSmoothing"="2"
"FontSmoothingType"=dword:00000002
"FontSmoothingGamma"=dword:00000578
"FontSmoothingOrientation"=dword:00000001

Possible values are:

  • FontSmoothing:
    • 0 — anti-aliasing disabled;
    • 2 — anti-aliasing enabled;
  • when anti-aliasing enabled, FontSmoothingType:
  • when subpixel, FontSmoothingOrientation:
    • 00000000 — BGR;
    • 00000001 — RGB.

Anti-aliasing fonts will be after the conclusion of regedit, and run wine applications again.

Sub-Menu

After installation, there will likely be no menu in your Desktop Manager. After installing a program using Wine, it will create a menu with your installed programs in it automatically. If you wish to add on to the menu to create a Ubuntu-like Wine sub-menu, then follow these instructions:

Create Menu Entries

First, install a Windows program using Wine to create the base menu. After the base menu is created, you can start to add the menu entries. In GNOME, right-click on the desktop and select "Create Launcher...". The steps might be different for KDE/Xfce. Make three launchers using these settings:

Type: Application
Name: Configuration
Command: winecfg
Comment: Configure the general settings for Wine
Type: Application
Name: Uninstall Programs
Command: wine uninstaller
Comment: Uninstall Windows programs under Wine properly
Type: Application
Name: Browse C:\ Drive
Command: wine winebrowser c:\\
Comment: Browse the files in the virtual Wine C:\ drive

Now that you have these three launchers on your desktop, it is time to put them into the menu. But, first you should change the launchers to dynamically change icons when a new icon set is installed. To do this, open the launchers that you just made in your favorite text editor. Change the following settings to these new values:


Configuration launcher:

Icon[en_US]=wine-winecfg
Icon=wine-winecfg

Uninstall Programs launcher:

Icon[en_US]=wine-uninstaller
Icon=wine-uninstaller

Browse C:\ Drive launcher:

Icon[en_US]=wine-winefile
Icon=wine-winefile

If these settings produce a ugly/non-existent icon, it means that there are no icons for these launchers in the icon set that you have enabled. You should replace the icon setting with the explicit location of the icon that you want. Clicking the icon in the launcher's properties menu will have the same effect. A great icon set that supports these shortcuts is GNOME-colors.

Now that you have the launchers fully configured, 'now' it is time to put them in the menu. Plop them into "~/.local/share/applications/wine/" using a terminal or file browser.

Wait a second, they aren't in the menu yet! There is one last step. Copy the following text into a text file named "wine-utilities.menu".

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd">
<Menu>
  <Name>Applications</Name>
  <Menu>
    <Name>wine-wine</Name>
    <Directory>wine-wine.directory</Directory>
    <Include>
	<Filename>wine-Configuration.desktop</Filename>
    </Include>
    <Include>
	<Filename>wine-Browse C:\ Drive.desktop</Filename>
    </Include>
    <Include>
	<Filename>wine-Uninstall Programs.desktop</Filename>
    </Include>
  </Menu>
</Menu>

Now, just move the newly made file to the "~/.config/menus/applications-merged/" folder. Go check in the menu and there should be the minty fresh options waiting to be used!

KDE 4 Menu Fix[1]

The Wine menu items may appear in "Lost & Found" instead of the Wine menu for KDE 4. This is because kde-applications.menu is missing the MergeDir option.

Edit /etc/xdg/menus/kde-applications.menu

At the end of the file add <MergeDir>applications-merged</MergeDir> after <DefaultMergeDirs/>, it should look like this:

        <Include>
                <And>
                        <Category>KDE</Category>
                        <Category>Core</Category>
                </And>
        </Include>
        <DefaultMergeDirs/>
        <MergeDir>applications-merged</MergeDir>
        <MergeFile>applications-kmenuedit.menu</MergeFile>
</Menu>

Alternatively you can create a symlink to a folder that KDE does see:

ln -s ~/.config/menus/applications-merged ~/.config/menus/kde-applications-merged

This has the added bonus that an update to KDE won't change it, but is per user instead of system wide.

Wine Configuration Utilities

These tools will assist in the installation of typical Windows components. In most cases they should be used as a last effort, as it may severely alter your wine configuration.

WineTricks

Winetricks is a quick (slightly dirty) script that will allow you to install base requirements needed to run some windows programs. Installable components include DirectX 9.x, msxml (office 2007 / IE requirement), visual runtimes and many more.

You can install winetricks from the AUR.

You can now start winetricks (as a normal user!) with:

$ winetricks

WineTools assistant

(currently slightly outdated, but working)

Winetools is a program (more of a script, in fact) that facilitates in the installation of some core components for wine in order to install other programs. Note this is not necessary for wine, but does help if you want to get Internet Explorer running.

WineTools Site

Microsoft policy is that you must have a license for IE6 in order to install DCOM98 or Internet Explorer 6. If you've ever owned a copy of Windows, you should be fine.

Sidenet Wine Configuration Utility

wine-config

  • Download the latest version
  • unpack it
  • READ THE README
  • execute
./setup
  • Follow the instructions

Keep in mind: Like stated on the site, you're only allowed to install DCOM98 if you possess a valid License for Windows98.

Wine-doors

Wine-doors

Wine-doors is a WineTools replacement. It features a GNOME GUI and works like a package manager. Works fine in 64bit. You can find it in the AUR.

PlayOnLinux

PlayOnLinux

PlayOnLinux is a GUI Windows and DOS program manager. It has many script to assist with the configuration and running of progams. You can find it in aur

Using Wine to execute Win16 / Win32 binaries

You can execute binaries by calling wine manually

wine programsname.exe

If installing using an MSI installer, use the included msiexec utility.

msiexec installername.msi

It is also possible to tell the kernel to use wine as an interpreter for all Win16/Win32 binaries. First mount the binfmt_misc filesystem:

mount -t binfmt_misc none /proc/sys/fs/binfmt_misc

or add this line to your /etc/fstab

none  /proc/sys/fs/binfmt_misc binfmt_misc defaults 0 0

Then tell the kernel how to interpret Win16 and Win32 binaries:

echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register

You can add this line to /etc/rc.local to make this setting permanent. In this case you may want to ignore stderr to avoid error messages when changing runlevels:

{ echo ':DOSWin:M::MZ::/usr/bin/wine:' > /proc/sys/fs/binfmt_misc/register; } 2>/dev/null

Now try this:

chmod 755 exefile.exe
./exefile.exe

You can even remove the .exe extension, because the kernel doesn't identify the file by its extension.

Alternatives to Win16 / Win32 binaries

  • Cedega - Aimed at gamers
  • CVSCedega - CVS source version of cedega
  • Codeweavers - Codeweavers' Crossover Office; Aimed at Office Users

External Resources