https://wiki.archlinux.org/api.php?action=feedcontributions&user=RedTide&feedformat=atomArchWiki - User contributions [en]2024-03-28T10:35:58ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Wine&diff=592134Wine2019-12-18T13:18:11Z<p>RedTide: Added wine-installer-git AUR package as alternative choice on Creating menu entries for Wine utilities section</p>
<hr />
<div>[[Category:Emulation]]<br />
[[Category:Gaming]]<br />
[[cs:Wine]]<br />
[[de:Wine]]<br />
[[es:Wine]]<br />
[[fr:Wine]]<br />
[[it:Wine]]<br />
[[ja:Wine]]<br />
[[ru:Wine]]<br />
[[zh-hans:Wine]]<br />
[[zh-hant:Wine]]<br />
{{Related articles start}}<br />
{{Related|CrossOver}}<br />
{{Related|Wine package guidelines}}<br />
{{Related articles end}}<br />
[[Wikipedia:Wine (software)|Wine]] is a ''compatibility layer'' capable of running Microsoft Windows applications on Unix-like operating systems. Programs running in Wine act as native programs would, without the performance/memory penalties of an emulator.<br />
<br />
{{Warning|If you can access a file or resource with your user account, programs running in Wine can too. See [[#Running Wine under a separate user account]] and [[Security#Sandboxing applications]] for possible precautions.}}<br />
<br />
== Installation ==<br />
<br />
Wine can be installed by enabling the [[multilib]] repository and [[install]]ing the {{Pkg|wine}} (stable) or {{Pkg|wine-staging}} (testing) package. [https://wine-staging.com/ Wine Staging] is a patched version of [https://www.winehq.org/ Wine], which contains bug fixes and features that have not been integrated into the stable branch yet. See also [[#Graphics drivers]] and [[#Sound]].<br />
<br />
Consider installing {{pkg|wine_gecko}} and {{pkg|wine-mono}} for applications that depend on Internet Explorer and .NET, respectively. These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each Wine prefix needing them.<br />
<br />
=== Third-party applications ===<br />
<br />
These have their own communities and websites, and are '''not supported''' by greater Wine community. See [https://wiki.winehq.org/Third_Party_Applications Wine Wiki] for more details.<br />
<br />
* {{App|[[CrossOver]]|Paid, commercialized version of Wine which provides more comprehensive end-user support.|https://www.codeweavers.com|{{AUR|crossover}}}}<br />
* {{App|exe-thumbnailer|Generates thumbnails for Windows executable files (.exe, .lnk, .msi, and .dll).|https://github.com/exe-thumbnailer/exe-thumbnailer|{{AUR|exe-thumbnailer}}}}<br />
* {{App|[[Wikipedia:Lutris|Lutris]]|Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.|https://lutris.net|{{Pkg|lutris}}}}<br />
* {{App|[[Wikipedia:PlayOnLinux|PlayOnLinux]]|Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.|https://www.playonlinux.com|{{Pkg|playonlinux}}}}<br />
* {{App|Proton|Compatibility tool made for [[Steam]] based on Wine and additional components. See [https://www.protondb.com/ ProtonDB] for compatibility list.|https://github.com/ValveSoftware/Proton|{{AUR|proton}}}}<br />
* {{App|PyWinery|Simple graphical prefix manager for Wine.|https://github.com/ergoithz/pywinery|{{AUR|pywinery}}}}<br />
* {{App|Q4Wine|Graphical prefix manager for Wine. Can export [[Qt]] themes into the Wine configuration for better integration.|https://sourceforge.net/projects/q4wine/|{{AUR|q4wine}}}}<br />
<br />
== Configuration ==<br />
Configuring Wine is typically accomplished using:<br />
* [https://wiki.winehq.org/Winecfg winecfg] is a GUI configuration tool for Wine, which can be started by running {{ic|winecfg}}.<br />
* [https://wiki.winehq.org/Regedit regedit] is Wine's registry editing tool, which can be started by running {{ic|regedit}}. See WineHQ's article on [https://wiki.winehq.org/Useful_Registry_Keys Useful Registry Keys].<br />
* [https://wiki.winehq.org/Control control] is Wine's implementation of the Windows Control Panel, which can be started by running {{ic|wine control}}.<br />
* See WineHQ's [https://wiki.winehq.org/List_of_Commands List of Commands] for the full list.<br />
<br />
=== WINEPREFIX ===<br />
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.wine}}. This directory is commonly called a "Wine prefix" or "Wine bottle". It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as ''winecfg''. The prefix directory also contains a tree which your Windows programs will see as {{ic|C:}} (the C-drive).<br />
<br />
You can override the location Wine uses for a prefix with the {{ic|WINEPREFIX}} [[environment variable]]. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.<br />
<br />
For example, if you run one program with {{ic|1= $ env WINEPREFIX=~/.win-a wine program-a.exe}}, and another with {{ic|1= $ env WINEPREFIX=~/.win-b wine program-b.exe}}, the two programs will each have a separate C-drive and separate registries.<br />
<br />
{{Note|Wine prefixes are not [[Wikipedia:Sandbox (computer security)|sandboxes]]! Programs running under Wine can still access the rest of the system! (for example, {{ic|Z:}} is mapped to {{ic|/}}, regardless of the Wine prefix).}}<br />
<br />
To create a default prefix without running a Windows program or other GUI tool you can use:<br />
$ env WINEPREFIX=~/.customprefix wineboot -u<br />
<br />
=== WINEARCH ===<br />
<br />
Wine will start an 64-bit environment by default. You can change this behavior using the {{ic|WINEARCH}} [[environment variable]]. Rename your {{ic|~/.wine}} directory and create a new Wine environment by running {{ic|1=$ WINEARCH=win32 winecfg}}. This will get you a 32-bit Wine environment. Not setting {{ic|WINEARCH}} will get you a 64-bit one.<br />
<br />
You can combine this with {{ic|WINEPREFIX}} to make a separate {{ic|win32}} and {{ic|win64}} environment:<br />
<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg<br />
$ WINEPREFIX=~/win64 winecfg<br />
<br />
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as ''winetricks'' (using Steam as an example):<br />
<br />
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam<br />
<br />
=== Graphics drivers ===<br />
<br />
You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the ''OpenGL (multilib)'' column in the table in [[Xorg#Driver installation]].<br />
<br />
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:<br />
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly<br />
<br />
{{Note|You might need to restart X after having installed the correct library.}}<br />
<br />
=== Sound ===<br />
<br />
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in ''winecfg''.<br />
<br />
* If you want to use the [[ALSA]] driver in Wine, you will need to install {{Pkg|lib32-alsa-lib}} and {{Pkg|lib32-alsa-plugins}}.<br />
* If you want to use the [[PulseAudio]] driver in Wine, you will need to install the {{Pkg|lib32-libpulse}} package.<br />
* If you want to use the [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.<br />
* Games that use advanced sound systems (''e.g.'' TESV: Skyrim) may additionally require installations of {{Pkg|lib32-openal}}.<br />
<br />
If ''winecfg'' '''still''' fails to detect the audio driver (Selected driver: (none)), [https://www.winehq.org/docs/wineusr-guide/using-regedit#Configuring_Sound configure it via the registry]. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open ''regedit'', look for the key HKEY_CURRENT_USER → Software → Wine → Drivers, and add a string called ''Audio'' and give it the value ''alsa''. Also, it may help to [[#WINEARCH|recreate the prefix]]. <br />
<br />
==== MIDI support ====<br />
<br />
[[MIDI]] was a quite popular system for video games music in the 90's. If you are trying out old games, it is not uncommon that the music will not play out of the box.<br />
Wine has excellent MIDI support. However you first need to make it work on your host system, as explained in [[MIDI]]. Last but not least you need to make sure Wine will use the correct MIDI output.<br />
<br />
=== Other libraries ===<br />
<br />
*Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install {{Pkg|lib32-libxml2}}.<br />
<br />
*Some applications that play music may require {{Pkg|lib32-mpg123}}.<br />
<br />
*Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require {{Pkg|lib32-lcms2}}.<br />
<br />
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.<br />
<br />
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.<br />
<br />
*Some applications require 32-bit video codecs or the program crashes. Install {{Pkg|lib32-gst-plugins-base}}, {{Pkg|lib32-gst-plugins-good}}, {{Aur|lib32-gst-plugins-bad}} and {{Aur|lib32-gst-plugins-ugly}}.<br />
<br />
=== Fonts ===<br />
<br />
If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:<br />
<br />
cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i" ; done<br />
<br />
Wine uses freetype to render fonts, and freetype's defaults changed a few releases ago. Try using this environment setting for wine programs:<br />
<br />
FREETYPE_PROPERTIES="truetype:interpreter-version=35"<br />
<br />
Another possibility is to install Microsoft's Truetype fonts into your wine prefix. See [[MS Fonts]]. If this does not help, try running {{ic|winetricks corefonts}} first, then {{ic|winetricks allfonts}} as a last resort.<br />
<br />
After running such programs, kill all Wine servers and run {{ic|winecfg}}. Fonts should be legible now.<br />
<br />
If the fonts look somehow smeared, import the following text file into the Wine registry with [https://wiki.winehq.org/FAQ#How_do_I_edit_the_Wine_registry.3F regedit]:<br />
<br />
Windows Registry Editor Version 5.00<br />
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]<br />
"ClientSideWithRender"="N"<br />
<br />
For high resolution displays, you can adjust dpi values in winecfg.<br />
<br />
See also [[Font configuration#Applications without fontconfig support]].<br />
<br />
==== Enable font smoothing ====<br />
A good way to improve wine font rendering is to enable cleartype font smoothing.<br />
To enable "Subpixel smoothing (ClearType) RGB":<br />
<br />
{{bc|<nowiki>cat << EOF > /tmp/fontsmoothing<br />
REGEDIT4<br />
<br />
[HKEY_CURRENT_USER\Control Panel\Desktop]<br />
"FontSmoothing"="2"<br />
"FontSmoothingOrientation"=dword:00000001<br />
"FontSmoothingType"=dword:00000002<br />
"FontSmoothingGamma"=dword:00000578<br />
EOF<br />
<br />
WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing 2> /dev/null</nowiki>}}<br />
<br />
For more information, check [https://askubuntu.com/a/219795/514682 the original answer]<br />
<br />
=== Desktop launcher menus ===<br />
<br />
When a Windows application installer creates a shortcut Wine creates a {{ic|.desktop}} file instead. The default locations for those files in Arch Linux are:<br />
* Desktop shortcuts are put in {{ic|~/Desktop}}<br />
* Start menu shortcuts are put in {{ic|~/.local/share/applications/wine/Programs/}}<br />
<br />
{{Note|1=Wine does not support installing Windows applications for all users, so it will not put {{ic|.desktop}} files in {{ic|/usr/share/applications}}. See WineHQ bug [https://bugs.winehq.org/show_bug.cgi?id=11112 11112]}}<br />
<br />
{{Tip|If menu items were ''not'' created while installing software or have been lost, {{ic|wine winemenubuilder}} may be of some use.}}<br />
<br />
==== Creating menu entries for Wine utilities ====<br />
<br />
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for ''winecfg'', ''winebrowser'', etc). This can be achieved by installing {{AUR|wine-installer}} or {{AUR|wine-installer-git}} meta-package (the latter has no additional dependencies), otherwise these instructions will add entries for these applications.<br />
<br />
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in {{ic|~/.local/share/applications/wine/}}:<br />
<br />
{{hc|wine-browsedrive.desktop|2=<br />
[Desktop Entry]<br />
Name=Browse C: Drive<br />
Comment=Browse your virtual C: drive<br />
Exec=wine winebrowser c:<br />
Terminal=false<br />
Type=Application<br />
Icon=folder-wine<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-uninstaller.desktop|2=<br />
[Desktop Entry]<br />
Name=Uninstall Wine Software<br />
Comment=Uninstall Windows applications for Wine<br />
Exec=wine uninstaller<br />
Terminal=false<br />
Type=Application<br />
Icon=wine-uninstaller<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-winecfg.desktop|2=<br />
[Desktop Entry]<br />
Name=Configure Wine<br />
Comment=Change application-specific and general Wine options<br />
Exec=winecfg<br />
Terminal=false<br />
Icon=wine-winecfg<br />
Type=Application<br />
Categories=Wine;<br />
}}<br />
<br />
And create the following file in {{ic|~/.config/menus/applications-merged/}}:<br />
<br />
{{hc|wine.menu|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"><br />
<Menu><br />
<Name>Applications</Name><br />
<Menu><br />
<Name>wine-wine</Name><br />
<Directory>wine-wine.directory</Directory><br />
<Include><br />
<Category>Wine</Category><br />
</Include><br />
</Menu><br />
</Menu><br />
</nowiki>}}<br />
<br />
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 settings 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 [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].<br />
<br />
==== Removing menu entries ====<br />
<br />
Menu entries created by Wine are located in {{ic|~/.local/share/applications/wine/Programs/}}. Remove the program's ''.desktop'' entry to remove the application from the menu.<br />
<br />
In addition to remove unwanted extensions binding by Wine, execute the following commands (taken from the Wine website):<br />
$ rm ~/.local/share/mime/packages/x-wine*<br />
$ rm ~/.local/share/applications/wine-extension*<br />
$ rm ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
$ rm ~/.local/share/mime/application/x-wine-extension*<br />
<br />
=== Appearance ===<br />
<br />
A similar to XP looking theme can be downloaded from [http://download.microsoft.com/download/e/a/9/ea9af5ae-b48e-473e-85fe-dcde7472e644/ZuneDesktopTheme.msi here]. To install it see [https://wiki.winehq.org/Wine_User%27s_Guide#Running_.msi_files here]. Lastly use ''winecfg'' to select it.<br />
Wine staging users may instead want to try enabling the option ''Enable GTK3 Theming'' under the Staging section of ''winecfg'' for a theme that matches the current GTK theme.<br />
<br />
=== Printing ===<br />
<br />
In order to use your installed printers (both local and network) with wine applications in ''win32 prefixes'' (e.g. MS Word), install the {{Pkg|lib32-libcups}} package, reboot wine (''wineboot'') and restart your wine application.<br />
<br />
== Usage ==<br />
<br />
{{Warning|Do not run or install Wine applications as root! See [https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F Wine FAQ] for details.}}<br />
<br />
See [https://wiki.winehq.org/FAQ Wine FAQ] and [https://wiki.winehq.org/Wine_User%27s_Guide Wine User's Guide] for general information on Wine usage.<br />
<br />
See [https://appdb.winehq.org/ Wine Application Database (AppDB)] for information on running Windows applications in Wine.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Wineconsole ===<br />
<br />
Often you may need to run ''.exe'''s to patch game files, for example a widescreen mod for an old game, and running the ''.exe'' normally through Wine might yield nothing happening. In this case, you can open a terminal and run the following command:<br />
<br />
$ wineconsole cmd<br />
<br />
Then navigate to the directory and run the ''.exe'' file from there.<br />
<br />
=== Winetricks ===<br />
<br />
[https://wiki.winehq.org/Winetricks Winetricks] is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.<br />
<br />
[[Install]] the {{pkg|winetricks}} package (or alternatively {{AUR|winetricks-git}}). Then run it with:<br />
$ winetricks<br />
<br />
=== Performance ===<br />
<br />
==== CSMT ====<br />
<br />
CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.2, CSMT is enabled by default. However, CSMT support needs to be enabled manually for Wine versions lower than 3.2. For vanilla Wine run {{ic|wine regedit}} and set the DWORD value for ''HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt'' to 0x01 (enabled). For wine-staging run {{ic|winecfg}} and enable it in the staging tab.<br />
<br />
Note that CSMT may actually hurt performance for some applications - if this is the case, disable it by creating/setting the registry value to 0x00 (disabled).<br />
<br />
Further information:<br />
*[http://www.phoronix.com/forums/showthread.php?93967-Wine-s-Big-Command-Stream-D3D-Patch-Set-Updated/page3&s=7775d7c3d4fa698089d5492bb7b1a435 Phoronix Forum discussion] with the CSMT developer Stefan Dösinger<br />
<br />
==== Force OpenGL mode in games ====<br />
<br />
Some games might have an OpenGL mode which ''may'' perform better than their default DirectX mode. While the steps to enable OpenGL rendering is ''application specific'', many games accept the {{Ic|-opengl}} parameter.<br />
$ wine ''/path/to/3d_game.exe'' -opengl<br />
<br />
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.<br />
<br />
==== DXVK ====<br />
[https://github.com/doitsujin/dxvk DXVK] is a promising new implementation for DirectX 10 and DirectX 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).<br />
<br />
To use it, install {{aur|dxvk-bin}}. Then run the following command to activate it in your Wineprefix (by default {{ic|~/.wine}}):<br />
$ WINEPREFIX=''your-prefix'' setup_dxvk install<br />
<br />
{{note|For Wine versions below 3.5 you need to configure Vulkan support manually, following the instructions at [https://github.com/roderickc/wine-vulkan GitHub]. {{Pkg|wine}} and {{Pkg|wine-staging}} work out of the box.}}<br />
<br />
{{warning|DXVK overrides the DirectX 10 and 11 DLLs, which may be considered cheating in online multiplayer games, and may get your account '''banned'''. Use at your own risk!}}<br />
<br />
==== Gallium Nine ====<br />
<br />
With the open-source gallium-based drivers (mostly AMD cards) there is a [https://wiki.ixit.cz/d3d9 Gallium Direct3D state tracker] that aims to provide nearly-native performance for DirectX 9. In most cases it has less visual glitches than the upstream wine and doubles the performances. It consumes much less CPU time than CSMT.<br />
<br />
Install {{Pkg|wine-nine}} to use it. This is a standalone package that can be installed with any wine version. Use {{ic|wine ninewinecfg}} to check if it's enabled.<br />
<br />
=== Unregister existing Wine file associations ===<br />
<br />
By default, Wine takes over as the default application for a lot of formats. Some (e.g. {{ic|vbs}} or {{ic|chm}}) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. {{ic|gif}}, {{ic|jpeg}}, {{ic|txt}}, {{ic|js}}) open in Wine's bare-bones simulations of Internet Explorer and Notepad can be annoying.<br />
<br />
Wine's file associations are set in {{ic|~/.local/share/applications/}} as {{ic|wine-extension-''extension''.desktop}} files. Delete the files corresponding to the extensions you want to unregister. Or, to remove all wine extensions:<br />
<br />
$ rm -f ~/.local/share/applications/wine-extension*.desktop<br />
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
<br />
Next, remove the old cache:<br />
<br />
$ rm -f ~/.local/share/applications/mimeinfo.cache<br />
$ rm -f ~/.local/share/mime/packages/x-wine*<br />
$ rm -f ~/.local/share/mime/application/x-wine-extension*<br />
<br />
And, update the cache:<br />
<br />
$ update-desktop-database ~/.local/share/applications<br />
$ update-mime-database ~/.local/share/mime/<br />
<br />
Alternatively you can delete all wine related stuff:<br />
<br />
$ find ~/.local/share -name "*wine*" | xargs -I '{}' --no-run-if-empty rm -r '{}'<br />
<br />
And update the cache as above.<br />
<br />
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.<br />
<br />
=== Prevent new Wine file associations ===<br />
<br />
Prevent wine from creating any file associations by editing the registry:<br />
<br />
{{hc|1=associations.reg|2=<br />
Windows Registry Editor Version 5.00<br />
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]<br />
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"<br />
}}<br />
<br />
Add this to your Wine registry, by running {{ic|wine regedit associations.reg}}, or alternatively by running {{ic|wine regedit}} and importing it from the menu in ''Registry > Import Registry File''.<br />
<br />
This has to be done for each WINEPREFIX which should not update file associations.<br />
<br />
This method prevents the creation of file associations but retains the creation of XDG .desktop files (that you might see e.g. in menus).<br />
<br />
If you want it to apply by default for new WINEPREFIXES, edit {{ic|/usr/share/wine/wine.inf}}.<br />
Find this line:<br />
<br />
HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -a -r"<br />
<br />
and remove the -a switch, so that the entry looks like this:<br />
<br />
HKLM,%CurrentVersion%\RunServices,"winemenubuilder",2,"%11%\winemenubuilder.exe -r"<br />
<br />
See [https://askubuntu.com/a/400430 this post] for more info.<br />
<br />
To prevent a package upgrade from overriding the modified file, create a pacman hook to make our change automatically:<br />
<br />
{{hc|1=/etc/pacman.d/hooks/stop-wine-associations.hook|2=<br />
[Trigger]<br />
Type = File<br />
Operation = Install<br />
Operation = Upgrade<br />
Target = usr/share/wine/wine.inf<br />
<br />
[Action]<br />
Description = Stopping Wine from hijacking file associations...<br />
When = PostTransaction<br />
Exec = /usr/bin/sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/g' /usr/share/wine/wine.inf<br />
}}<br />
<br />
See [[Pacman#Hooks]].<br />
<br />
Alternatively, you can disable winemenubuilder altogether (including the desktop entries) for all WINEPREFIXes by setting an environment variable:<br />
<br />
$ export WINEDLLOVERRIDES="winemenubuilder.exe=d"<br />
<br />
=== Execute Windows binaries with Wine implicitly ===<br />
<br />
The {{pkg|wine}} package installs a ''binfmt'' file which will allow you to run Windows programs directly, e.g. {{ic|''./myprogram.exe''}} will launch as if you had typed {{ic|wine ''./myprogram.exe''}}. All you have to do in order to use this is to [[start]]/[[enable]] {{ic|systemd-binfmt.service}}.<br />
<br />
{{Note|Make sure the Windows binary is executable, otherwise the binary will not be executed: e.g. run {{ic|chmod +x ''windows-binary''}}.}}<br />
<br />
=== Dual Head with different resolutions ===<br />
<br />
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.<br />
<br />
Also installing {{Pkg|lib32-libxinerama}} might fix dual-head issues with wine (for example, unclickable buttons and menus of application in the right most or bottom most monitor, not redrawable interface of application in that zone, dragging mouse cursor state stucked after leaving application area).<br />
<br />
=== Burning optical media ===<br />
<br />
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel module]].<br />
<br />
=== Proper mounting of optical media images ===<br />
<br />
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in ''winecfg''.<br />
However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.<br />
<br />
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.<br />
<br />
=== Show FPS overlay in games ===<br />
<br />
Wine features an embedded FPS monitor which works for all graphical applications if the environment variable {{ic|1=WINEDEBUG=fps}} is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to {{ic|osd_cat}} from the {{pkg|xosd}} package. See [https://gist.github.com/anonymous/844aefd70bb50bf72b35 winefps.sh] for a helper script.<br />
<br />
=== Running Wine under a separate user account ===<br />
<br />
It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.<br />
<br />
First, create a [[user account]] for Wine:<br />
<br />
# useradd -m -s /bin/bash wineuser<br />
<br />
Now switch to another TTY and start your X WM or DE as you normally would or keep reading...<br />
<br />
{{Note|The following approach only works when enabling root for Xorg. See [[Xorg#Rootless Xorg]] for more information.}}<br />
<br />
Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:<br />
<br />
$ xhost +SI:localuser:wineuser<br />
<br />
Finally, you can run Wine via the following command, which uses {{ic|env}} to launch Wine with the environment variables it expects:<br />
<br />
$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine ''arguments''<br />
<br />
It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:<br />
{{hc|1=/usr/local/bin/runaswine|2=<br />
#!/bin/bash<br />
xhost +SI:localuser:wineuser<br />
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"}}<br />
<br />
Wine applications can then be launched via:<br />
<br />
$ runaswine ''"C:\path\to\application.exe"''<br />
<br />
In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: {{ic|1=''mainuser'' ALL=(wineuser) NOPASSWD: ALL}}. See [[Sudo#Configuration]] for more information.<br />
<br />
It is recommended to run {{ic|winecfg}} as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the "Desktop Integration" section of the configuration window so no program run with Wine has read access to any file outside the special user's home directory.<br />
<br />
Keep in mind that audio will probably be non-functional in Wine programs which are run this way if [[PulseAudio]] is used. See [[PulseAudio/Examples#Allowing multiple users to use PulseAudio at the same time]] for information about allowing the Wine user to access the PulseAudio daemon of the principal user.<br />
<br />
=== Temp directory on tmpfs ===<br />
<br />
To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like ''tmpfs''. Remove Wine's default directory for temporary files and creating a symlink:<br />
<br />
$ rm -r ~/.wine/drive_c/users/$USER/Temp<br />
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp<br />
<br />
=== Prevent installing Mono/Gecko ===<br />
If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by setting the {{ic|WINEDLLOVERRIDES}} [[environment variable]] to {{ic|1=mscoree=d;mshtml=d}}.<br />
<br />
=== Vulkan ===<br />
Vulkan support is included, since Wine 3.3. The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author's [https://github.com/roderickc/wine-vulkan GitHub page].<br />
<br />
{{note|The Wine ICD loader was added in Wine 3.5, you need to install the official Vulkan SDK to use Vulkan in Wine 3.3 and 3.4}}<br />
<br />
=== Remove Wine file bindings ===<br />
For security reasons it may be useful to remove the preinstalled Wine bindings so Windows applications can't be launched directly from a file manager or from the browser (Firefox offers to open EXE files directly with Wine!).<br />
If you want to do this, you may add the following to the {{ic|1= [options]}} section in {{ic|1= /etc/pacman.conf}}<br />
<br />
NoExtract = usr/lib/binfmt.d/wine.conf<br />
NoExtract = usr/share/applications/wine.desktop<br />
<br />
== See also ==<br />
<br />
* [https://www.winehq.org/ Wine Homepage]<br />
* [https://wiki.winehq.org/ Wine Wiki]<br />
* [https://appdb.winehq.org/ Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)<br />
* [https://forum.winehq.org/ Wine Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB<br />
* [https://wiki.gentoo.org/wiki/Wine Wine - Gentoo Wiki]</div>RedTidehttps://wiki.archlinux.org/index.php?title=Wine&diff=575643Wine2019-06-15T16:37:43Z<p>RedTide: Specify wine-installer is a meta-package</p>
<hr />
<div>[[Category:Emulation]]<br />
[[Category:Gaming]]<br />
[[cs:Wine]]<br />
[[de:Wine]]<br />
[[es:Wine]]<br />
[[fr:Wine]]<br />
[[it:Wine]]<br />
[[ja:Wine]]<br />
[[ru:Wine]]<br />
[[zh-hans:Wine]]<br />
[[zh-hant:Wine]]<br />
{{Related articles start}}<br />
{{Related|CrossOver}}<br />
{{Related|Wine package guidelines}}<br />
{{Related articles end}}<br />
[[Wikipedia:Wine (software)|Wine]] is a ''compatibility layer'' capable of running Microsoft Windows applications on Unix-like operating systems. Programs running in Wine act as native programs would, without the performance/memory penalties of an emulator.<br />
<br />
{{Warning|If you can access a file or resource with your user account, programs running in Wine can too. See [[#Running Wine under a separate user account]] and [[Security#Sandboxing applications]] for possible precautions.}}<br />
<br />
== Installation ==<br />
<br />
Wine can be installed by enabling the [[multilib]] repository and [[install]]ing the {{Pkg|wine}} (stable) or {{Pkg|wine-staging}} (testing) package. [https://wine-staging.com/ Wine Staging] is a patched version of [https://www.winehq.org/ Wine], which contains bug fixes and features that have not been integrated into the stable branch yet. See also [[#Graphics drivers]] and [[#Sound]].<br />
<br />
Consider installing {{pkg|wine_gecko}} and {{pkg|wine-mono}} for applications that depend on Internet Explorer and .NET, respectively. These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each Wine prefix needing them.<br />
<br />
=== Third-party applications ===<br />
<br />
These have their own communities and websites, and are '''not supported''' by greater Wine community. See [https://wiki.winehq.org/Third_Party_Applications Wine Wiki] for more details.<br />
<br />
* {{App|[[CrossOver]]|Paid, commercialized version of Wine which provides more comprehensive end-user support.|https://www.codeweavers.com|{{AUR|crossover}}}}<br />
* {{App|exe-thumbnailer|Generates thumbnails for Windows executable files (.exe, .lnk, .msi, and .dll).|https://github.com/exe-thumbnailer/exe-thumbnailer|{{AUR|exe-thumbnailer}}}}<br />
* {{App|[[Wikipedia:Lutris|Lutris]]|Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.|https://lutris.net|{{Pkg|lutris}}}}<br />
* {{App|[[Wikipedia:PlayOnLinux|PlayOnLinux]]|Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.|https://www.playonlinux.com|{{Pkg|playonlinux}}}}<br />
* {{App|Proton|Compatibility tool made for [[Steam]] based on Wine and additional components. See [https://www.protondb.com/ ProtonDB] for compatibility list.|https://github.com/ValveSoftware/Proton|{{AUR|proton}}}}<br />
* {{App|PyWinery|Simple graphical prefix manager for Wine.|https://github.com/ergoithz/pywinery|{{AUR|pywinery}}}}<br />
* {{App|Q4Wine|Graphical prefix manager for Wine. Can export [[Qt]] themes into the Wine configuration for better integration.|https://sourceforge.net/projects/q4wine/|{{AUR|q4wine}}}}<br />
<br />
== Configuration ==<br />
Configuring Wine is typically accomplished using:<br />
* [https://wiki.winehq.org/Winecfg winecfg] is a GUI configuration tool for Wine, which can be started by running {{ic|winecfg}}.<br />
* [https://wiki.winehq.org/Regedit regedit] is Wine's registry editing tool, which can be started by running {{ic|regedit}}. See WineHQ's article on [https://wiki.winehq.org/Useful_Registry_Keys Useful Registry Keys].<br />
* [https://wiki.winehq.org/Control control] is Wine's implementation of the Windows Control Panel, which can be started by running {{ic|wine control}}.<br />
* See WineHQ's [https://wiki.winehq.org/List_of_Commands List of Commands] for the full list.<br />
<br />
=== WINEPREFIX ===<br />
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.wine}}. This directory is commonly called a "Wine prefix" or "Wine bottle". It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as ''winecfg''. The prefix directory also contains a tree which your Windows programs will see as {{ic|C:}} (the C-drive).<br />
<br />
You can override the location Wine uses for a prefix with the {{ic|WINEPREFIX}} [[environment variable]]. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.<br />
<br />
For example, if you run one program with {{ic|1= $ env WINEPREFIX=~/.win-a wine program-a.exe}}, and another with {{ic|1= $ env WINEPREFIX=~/.win-b wine program-b.exe}}, the two programs will each have a separate C-drive and separate registries.<br />
<br />
{{Note|Wine prefixes are not [[Wikipedia:Sandbox (computer security)|sandboxes]]! Programs running under Wine can still access the rest of the system! (for example, {{ic|Z:}} is mapped to {{ic|/}}, regardless of the Wine prefix).}}<br />
<br />
To create a default prefix without running a Windows program or other GUI tool you can use:<br />
$ env WINEPREFIX=~/.customprefix wineboot -u<br />
<br />
=== WINEARCH ===<br />
<br />
Wine will start an 64-bit environment by default. You can change this behavior using the {{ic|WINEARCH}} [[environment variable]]. Rename your {{ic|~/.wine}} directory and create a new Wine environment by running {{ic|1=$ WINEARCH=win32 winecfg}}. This will get you a 32-bit Wine environment. Not setting {{ic|WINEARCH}} will get you a 64-bit one.<br />
<br />
You can combine this with {{ic|WINEPREFIX}} to make a separate {{ic|win32}} and {{ic|win64}} environment:<br />
<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg<br />
$ WINEPREFIX=~/win64 winecfg<br />
<br />
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as ''winetricks'' (using Steam as an example):<br />
<br />
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam<br />
<br />
=== Graphics drivers ===<br />
<br />
You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the ''OpenGL (multilib)'' column in the table in [[Xorg#Driver installation]].<br />
<br />
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:<br />
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly<br />
<br />
{{Note|You might need to restart X after having installed the correct library.}}<br />
<br />
=== Sound ===<br />
<br />
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in ''winecfg''.<br />
<br />
* If you want to use the [[ALSA]] driver in Wine, you will need to install {{Pkg|lib32-alsa-lib}} and {{Pkg|lib32-alsa-plugins}}.<br />
* If you want to use the [[PulseAudio]] driver in Wine, you will need to install the {{Pkg|lib32-libpulse}} package.<br />
* If you want to use the [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.<br />
* Games that use advanced sound systems (''e.g.'' TESV: Skyrim) may additionally require installations of {{Pkg|lib32-openal}}.<br />
<br />
If ''winecfg'' '''still''' fails to detect the audio driver (Selected driver: (none)), [https://www.winehq.org/docs/wineusr-guide/using-regedit#Configuring_Sound configure it via the registry]. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open ''regedit'', look for the key HKEY_CURRENT_USER → Software → Wine → Drivers, and add a string called ''Audio'' and give it the value ''alsa''. Also, it may help to [[#WINEARCH|recreate the prefix]]. <br />
<br />
==== MIDI support ====<br />
<br />
[[MIDI]] was a quite popular system for video games music in the 90's. If you are trying out old games, it is not uncommon that the music will not play out of the box.<br />
Wine has excellent MIDI support. However you first need to make it work on your host system, as explained in [[MIDI]]. Last but not least you need to make sure Wine will use the correct MIDI output.<br />
<br />
=== Other libraries ===<br />
<br />
*Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install {{Pkg|lib32-libxml2}}.<br />
<br />
*Some applications that play music may require {{Pkg|lib32-mpg123}}.<br />
<br />
*Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require {{Pkg|lib32-lcms2}}.<br />
<br />
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.<br />
<br />
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.<br />
<br />
*Some applications require 32-bit video codecs or the program crashes. Install {{Pkg|lib32-gst-plugins-base}}, {{Pkg|lib32-gst-plugins-good}}, {{Aur|lib32-gst-plugins-bad}} and {{Aur|lib32-gst-plugins-ugly}}.<br />
<br />
=== Fonts ===<br />
<br />
If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:<br />
<br />
cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i" ; done<br />
<br />
Wine uses freetype to render fonts, and freetype's defaults changed a few releases ago. Try using this environment setting for wine programs:<br />
<br />
FREETYPE_PROPERTIES="truetype:interpreter-version=35"<br />
<br />
Another possibility is to install Microsoft's Truetype fonts into your wine prefix. See [[MS Fonts]]. If this does not help, try running {{ic|winetricks corefonts}} first, then {{ic|winetricks allfonts}} as a last resort.<br />
<br />
After running such programs, kill all Wine servers and run {{ic|winecfg}}. Fonts should be legible now.<br />
<br />
If the fonts look somehow smeared, import the following text file into the Wine registry with [https://wiki.winehq.org/FAQ#How_do_I_edit_the_Wine_registry.3F regedit]:<br />
<br />
Windows Registry Editor Version 5.00<br />
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]<br />
"ClientSideWithRender"="N"<br />
<br />
For high resolution displays, you can adjust dpi values in winecfg.<br />
<br />
See also [[Font configuration#Applications without fontconfig support]].<br />
<br />
==== Enable font smoothing ====<br />
A good way to improve wine font rendering is to enable cleartype font smoothing.<br />
To enable "Subpixel smoothing (ClearType) RGB":<br />
<br />
{{bc|<nowiki>cat << EOF > /tmp/fontsmoothing<br />
REGEDIT4<br />
<br />
[HKEY_CURRENT_USER\Control Panel\Desktop]<br />
"FontSmoothing"="2"<br />
"FontSmoothingOrientation"=dword:00000001<br />
"FontSmoothingType"=dword:00000002<br />
"FontSmoothingGamma"=dword:00000578<br />
EOF<br />
<br />
WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing 2> /dev/null</nowiki>}}<br />
<br />
For more information, check [https://askubuntu.com/a/219795/514682 the original answer]<br />
<br />
=== Desktop launcher menus ===<br />
<br />
When a Windows application installer creates a shortcut Wine creates a {{ic|.desktop}} file instead. The default locations for those files in Arch Linux are:<br />
* Desktop shortcuts are put in {{ic|~/Desktop}}<br />
* Start menu shortcuts are put in {{ic|~/.local/share/applications/wine/Programs/}}<br />
<br />
{{Note|1=Wine does not support installing Windows applications for all users, so it will not put {{ic|.desktop}} files in {{ic|/usr/share/applications}}. See WineHQ bug [https://bugs.winehq.org/show_bug.cgi?id=11112 11112]}}<br />
<br />
{{Tip|If menu items were ''not'' created while installing software or have been lost, {{ic|wine winemenubuilder}} may be of some use.}}<br />
<br />
==== Creating menu entries for Wine utilities ====<br />
<br />
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for ''winecfg'', ''winebrowser'', etc). This can be achieved by installing {{AUR | wine-installer}} meta-package, otherwise these instructions will add entries for these applications.<br />
<br />
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in {{ic|~/.local/share/applications/wine/}}:<br />
<br />
{{hc|wine-browsedrive.desktop|2=<br />
[Desktop Entry]<br />
Name=Browse C: Drive<br />
Comment=Browse your virtual C: drive<br />
Exec=wine winebrowser c:<br />
Terminal=false<br />
Type=Application<br />
Icon=folder-wine<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-uninstaller.desktop|2=<br />
[Desktop Entry]<br />
Name=Uninstall Wine Software<br />
Comment=Uninstall Windows applications for Wine<br />
Exec=wine uninstaller<br />
Terminal=false<br />
Type=Application<br />
Icon=wine-uninstaller<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-winecfg.desktop|2=<br />
[Desktop Entry]<br />
Name=Configure Wine<br />
Comment=Change application-specific and general Wine options<br />
Exec=winecfg<br />
Terminal=false<br />
Icon=wine-winecfg<br />
Type=Application<br />
Categories=Wine;<br />
}}<br />
<br />
And create the following file in {{ic|~/.config/menus/applications-merged/}}:<br />
<br />
{{hc|wine.menu|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"><br />
<Menu><br />
<Name>Applications</Name><br />
<Menu><br />
<Name>wine-wine</Name><br />
<Directory>wine-wine.directory</Directory><br />
<Include><br />
<Category>Wine</Category><br />
</Include><br />
</Menu><br />
</Menu><br />
</nowiki>}}<br />
<br />
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 settings 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 [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].<br />
<br />
==== Removing menu entries ====<br />
<br />
Menu entries created by Wine are located in {{ic|~/.local/share/applications/wine/Programs/}}. Remove the program's ''.desktop'' entry to remove the application from the menu.<br />
<br />
In addition to remove unwanted extensions binding by Wine, execute the following commands (taken from the Wine website):<br />
$ rm ~/.local/share/mime/packages/x-wine*<br />
$ rm ~/.local/share/applications/wine-extension*<br />
$ rm ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
$ rm ~/.local/share/mime/application/x-wine-extension*<br />
<br />
=== Appearance ===<br />
<br />
A similar to XP looking theme can be downloaded from [http://download.microsoft.com/download/e/a/9/ea9af5ae-b48e-473e-85fe-dcde7472e644/ZuneDesktopTheme.msi here]. To install it see [https://wiki.winehq.org/Wine_User%27s_Guide#Running_.msi_files here]. Lastly use ''winecfg'' to select it.<br />
Wine staging users may instead want to try enabling the option ''Enable GTK3 Theming'' under the Staging section of ''winecfg'' for a theme that matches the current GTK+ theme.<br />
<br />
=== Printing ===<br />
<br />
In order to use your installed printers (both local and network) with wine applications in ''win32 prefixes'' (e.g. MS Word), install the {{Pkg|lib32-libcups}} package, reboot wine (''wineboot'') and restart your wine application.<br />
<br />
== Usage ==<br />
<br />
{{Warning|Do not run or install Wine applications as root! See [https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F Wine FAQ] for details.}}<br />
<br />
See [https://wiki.winehq.org/FAQ Wine FAQ] and [https://wiki.winehq.org/Wine_User%27s_Guide Wine User's Guide] for general information on Wine usage.<br />
<br />
See [https://appdb.winehq.org/ Wine Application Database (AppDB)] for information on running Windows applications in Wine.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Wineconsole ===<br />
<br />
Often you may need to run ''.exe'''s to patch game files, for example a widescreen mod for an old game, and running the ''.exe'' normally through Wine might yield nothing happening. In this case, you can open a terminal and run the following command:<br />
<br />
$ wineconsole cmd<br />
<br />
Then navigate to the directory and run the ''.exe'' file from there.<br />
<br />
=== Winetricks ===<br />
<br />
[https://wiki.winehq.org/Winetricks Winetricks] is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.<br />
<br />
[[Install]] the {{pkg|winetricks}} package (or alternatively {{AUR|winetricks-git}}). Then run it with:<br />
$ winetricks<br />
<br />
=== Performance ===<br />
<br />
==== CSMT ====<br />
<br />
CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.2, CSMT is enabled by default. However, CSMT support needs to be enabled manually for Wine versions lower than 3.2. For vanilla Wine run {{ic|wine regedit}} and set the DWORD value for ''HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt'' to 0x01 (enabled). For wine-staging run {{ic|winecfg}} and enable it in the staging tab.<br />
<br />
Note that CSMT may actually hurt performance for some applications - if this is the case, disable it by creating/setting the registry value to 0x00 (disabled).<br />
<br />
Further information:<br />
*[http://www.phoronix.com/forums/showthread.php?93967-Wine-s-Big-Command-Stream-D3D-Patch-Set-Updated/page3&s=7775d7c3d4fa698089d5492bb7b1a435 Phoronix Forum discussion] with the CSMT developer Stefan Dösinger<br />
<br />
==== Force OpenGL mode in games ====<br />
<br />
Some games might have an OpenGL mode which ''may'' perform better than their default DirectX mode. While the steps to enable OpenGL rendering is ''application specific'', many games accept the {{Ic|-opengl}} parameter.<br />
$ wine ''/path/to/3d_game.exe'' -opengl<br />
<br />
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.<br />
<br />
==== DXVK ====<br />
[https://github.com/doitsujin/dxvk DXVK] is a promising new implementation for DirectX 10 and DirectX 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).<br />
<br />
To use it, install {{aur|dxvk-bin}} for official binaries, or {{aur|dxvk-git}}{{Broken package link|package not found}} for the development version. Then run the following command to activate it in your Wineprefix (by default {{ic|~/.wine}}):<br />
$ WINEPREFIX=''your-prefix'' setup_dxvk64<br />
<br />
Use {{ic|setup_dxvk32}} for 32-bit applications.<br />
<br />
{{note|For Wine versions below 3.5 you need to configure Vulkan support manually, following the instructions at [https://github.com/roderickc/wine-vulkan GitHub]. {{Pkg|wine}} and {{Pkg|wine-staging}} work out of the box.}}<br />
<br />
{{warning|DXVK overrides the DirectX 10 and 11 DLLs, which may be considered cheating in online multiplayer games, and may get your account '''banned'''. Use at your own risk!}}<br />
<br />
==== Gallium Nine ====<br />
<br />
With the open-source gallium-based drivers (mostly AMD cards) there is a [https://wiki.ixit.cz/d3d9 Gallium Direct3D state tracker] that aims to provide nearly-native performance for DirectX 9. In most cases it has less visual glitches than the upstream wine and doubles the performances. It consumes much less CPU time than CSMT.<br />
<br />
To use it, install {{Pkg|wine-nine}}. This is a standalone package that can be installed with any wine version. You may need to enable it with {{ic|wine ninewinecfg.exe}} found in the {{ic|/usr/lib32/wine/fakedlls/}} directory.<br />
<br />
=== Unregister existing Wine file associations ===<br />
<br />
By default, Wine takes over as the default application for a lot of formats. Some (e.g. {{ic|vbs}} or {{ic|chm}}) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. {{ic|gif}}, {{ic|jpeg}}, {{ic|txt}}, {{ic|js}}) open in Wine's bare-bones simulations of Internet Explorer and Notepad can be annoying.<br />
<br />
Wine's file associations are set in {{ic|~/.local/share/applications/}} as {{ic|wine-extension-''extension''.desktop}} files. Delete the files corresponding to the extensions you want to unregister. Or, to remove all wine extensions:<br />
<br />
$ rm -f ~/.local/share/applications/wine-extension*.desktop<br />
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
<br />
Next, remove the old cache:<br />
<br />
$ rm -f ~/.local/share/applications/mimeinfo.cache<br />
$ rm -f ~/.local/share/mime/packages/x-wine*<br />
$ rm -f ~/.local/share/mime/application/x-wine-extension*<br />
<br />
And, update the cache:<br />
<br />
$ update-desktop-database ~/.local/share/applications<br />
$ update-mime-database ~/.local/share/mime/<br />
<br />
Alternatively you can delete all wine related stuff:<br />
<br />
$ find ~/.local/share -name "*wine*" | xargs -I '{}' --no-run-if-empty rm -r '{}'<br />
<br />
And update the cache as above.<br />
<br />
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.<br />
<br />
=== Prevent new Wine file associations ===<br />
<br />
Prevent wine from creating any file associations by editing the registry:<br />
<br />
{{hc|1=associations.reg|2=<br />
Windows Registry Editor Version 5.00<br />
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]<br />
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"<br />
}}<br />
<br />
Add this to your Wine registry, by running {{ic|wine regedit associations.reg}}, or alternatively by running {{ic|wine regedit}} and importing it from the menu in ''Registry > Import Registry File''.<br />
<br />
This has to be done for each WINEPREFIX which should not update file associations.<br />
<br />
You can disable winemenubuilder for all WINEPREFIXes by setting an environment variable:<br />
<br />
$ export WINEDLLOVERRIDES="winemenubuilder.exe=d"<br />
<br />
=== Execute Windows binaries with Wine implicitly ===<br />
<br />
The {{pkg|wine}} package installs a ''binfmt'' file which will allow you to run Windows programs directly, e.g. {{ic|''./myprogram.exe''}} will launch as if you had typed {{ic|wine ''./myprogram.exe''}}. All you have to do in order to use this is to [[start]]/[[enable]] {{ic|systemd-binfmt.service}}.<br />
<br />
{{Note|Make sure the Windows binary is executable, otherwise the binary will not be executed: e.g. run {{ic|chmod +x ''windows-binary''}}.}}<br />
<br />
=== Dual Head with different resolutions ===<br />
<br />
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.<br />
<br />
Also installing {{Pkg|lib32-libxinerama}} might fix dual-head issues with wine (for example, unclickable buttons and menus of application in the right most or bottom most monitor, not redrawable interface of application in that zone, dragging mouse cursor state stucked after leaving application area).<br />
<br />
=== Burning optical media ===<br />
<br />
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel module]].<br />
<br />
=== Proper mounting of optical media images ===<br />
<br />
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in ''winecfg''.<br />
However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.<br />
<br />
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.<br />
<br />
=== Show FPS overlay in games ===<br />
<br />
Wine features an embedded FPS monitor which works for all graphical applications if the environment variable {{ic|1=WINEDEBUG=fps}} is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to {{ic|osd_cat}} from the {{pkg|xosd}} package. See [https://gist.github.com/anonymous/844aefd70bb50bf72b35 winefps.sh] for a helper script.<br />
<br />
=== Running Wine under a separate user account ===<br />
<br />
It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.<br />
<br />
First, create a [[user account]] for Wine:<br />
<br />
# useradd -m -s /bin/bash wineuser<br />
<br />
Now switch to another TTY and start your X WM or DE as you normally would or keep reading...<br />
<br />
{{Note|The following approach only works when enabling root for Xorg. See [[Xorg#Rootless Xorg]] for more information.}}<br />
<br />
Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:<br />
<br />
$ xhost +SI:localuser:wineuser<br />
<br />
Finally, you can run Wine via the following command, which uses {{ic|env}} to launch Wine with the environment variables it expects:<br />
<br />
$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine ''arguments''<br />
<br />
It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:<br />
{{hc|1=/usr/local/bin/runaswine|2=<br />
#!/bin/bash<br />
xhost +SI:localuser:wineuser<br />
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"}}<br />
<br />
Wine applications can then be launched via:<br />
<br />
$ runaswine ''"C:\path\to\application.exe"''<br />
<br />
In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: {{ic|1=''mainuser'' ALL=(wineuser) NOPASSWD: ALL}}. See [[Sudo#Configuration]] for more information.<br />
<br />
It is recommended to run {{ic|winecfg}} as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the "Desktop Integration" section of the configuration window so no program run with Wine has read access to any file outside the special user's home directory.<br />
<br />
Keep in mind that audio will probably be non-functional in Wine programs which are run this way if [[PulseAudio]] is used. See [[PulseAudio/Examples#Allowing multiple users to use PulseAudio at the same time]] for information about allowing the Wine user to access the PulseAudio daemon of the principal user.<br />
<br />
=== Temp directory on tmpfs ===<br />
<br />
To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like ''tmpfs''. Remove Wine's default directory for temporary files and creating a symlink:<br />
<br />
$ rm -r ~/.wine/drive_c/users/$USER/Temp<br />
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp<br />
<br />
=== Prevent installing Mono/Gecko ===<br />
If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by setting the {{ic|WINEDLLOVERRIDES}} [[environment variable]] to {{ic|1=mscoree=d;mshtml=d}}.<br />
<br />
=== Vulkan ===<br />
Vulkan support is included, since Wine 3.3. The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author's [https://github.com/roderickc/wine-vulkan GitHub page].<br />
<br />
{{note|The Wine ICD loader was added in Wine 3.5, you need to install the official Vulkan SDK to use Vulkan in Wine 3.3 and 3.4}}<br />
<br />
=== Remove Wine file bindings ===<br />
For security reasons it may be useful to remove the preinstalled Wine bindings so Windows applications can't be launched directly from a file manager or from the browser (Firefox offers to open EXE files directly with Wine!).<br />
If you want to do this, you may add the following to the {{ic|1= [options]}} section in {{ic|1= /etc/pacman.conf}}<br />
<br />
NoExtract = usr/lib/binfmt.d/wine.conf<br />
NoExtract = usr/share/applications/wine.desktop<br />
<br />
== See also ==<br />
<br />
* [https://www.winehq.org/ Wine Homepage]<br />
* [https://wiki.winehq.org/ Wine Wiki]<br />
* [https://appdb.winehq.org/ Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)<br />
* [https://forum.winehq.org/ Wine Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB<br />
* [https://wiki.gentoo.org/wiki/Wine Wine - Gentoo Wiki]</div>RedTidehttps://wiki.archlinux.org/index.php?title=Wine&diff=575642Wine2019-06-15T16:34:24Z<p>RedTide: Added wine-installer AUR package reference to Creating menu entries for Wine utilities section</p>
<hr />
<div>[[Category:Emulation]]<br />
[[Category:Gaming]]<br />
[[cs:Wine]]<br />
[[de:Wine]]<br />
[[es:Wine]]<br />
[[fr:Wine]]<br />
[[it:Wine]]<br />
[[ja:Wine]]<br />
[[ru:Wine]]<br />
[[zh-hans:Wine]]<br />
[[zh-hant:Wine]]<br />
{{Related articles start}}<br />
{{Related|CrossOver}}<br />
{{Related|Wine package guidelines}}<br />
{{Related articles end}}<br />
[[Wikipedia:Wine (software)|Wine]] is a ''compatibility layer'' capable of running Microsoft Windows applications on Unix-like operating systems. Programs running in Wine act as native programs would, without the performance/memory penalties of an emulator.<br />
<br />
{{Warning|If you can access a file or resource with your user account, programs running in Wine can too. See [[#Running Wine under a separate user account]] and [[Security#Sandboxing applications]] for possible precautions.}}<br />
<br />
== Installation ==<br />
<br />
Wine can be installed by enabling the [[multilib]] repository and [[install]]ing the {{Pkg|wine}} (stable) or {{Pkg|wine-staging}} (testing) package. [https://wine-staging.com/ Wine Staging] is a patched version of [https://www.winehq.org/ Wine], which contains bug fixes and features that have not been integrated into the stable branch yet. See also [[#Graphics drivers]] and [[#Sound]].<br />
<br />
Consider installing {{pkg|wine_gecko}} and {{pkg|wine-mono}} for applications that depend on Internet Explorer and .NET, respectively. These packages are not strictly required as Wine will download the relevant files as needed. However, having the files downloaded in advance allows you to work off-line and makes it so Wine does not download the files for each Wine prefix needing them.<br />
<br />
=== Third-party applications ===<br />
<br />
These have their own communities and websites, and are '''not supported''' by greater Wine community. See [https://wiki.winehq.org/Third_Party_Applications Wine Wiki] for more details.<br />
<br />
* {{App|[[CrossOver]]|Paid, commercialized version of Wine which provides more comprehensive end-user support.|https://www.codeweavers.com|{{AUR|crossover}}}}<br />
* {{App|exe-thumbnailer|Generates thumbnails for Windows executable files (.exe, .lnk, .msi, and .dll).|https://github.com/exe-thumbnailer/exe-thumbnailer|{{AUR|exe-thumbnailer}}}}<br />
* {{App|[[Wikipedia:Lutris|Lutris]]|Gaming launcher for all types of games, including Wine games (with prefix management), native Linux games and emulators.|https://lutris.net|{{Pkg|lutris}}}}<br />
* {{App|[[Wikipedia:PlayOnLinux|PlayOnLinux]]|Graphical prefix manager for Wine. Contains scripts to assist with program installation and configuration.|https://www.playonlinux.com|{{Pkg|playonlinux}}}}<br />
* {{App|Proton|Compatibility tool made for [[Steam]] based on Wine and additional components. See [https://www.protondb.com/ ProtonDB] for compatibility list.|https://github.com/ValveSoftware/Proton|{{AUR|proton}}}}<br />
* {{App|PyWinery|Simple graphical prefix manager for Wine.|https://github.com/ergoithz/pywinery|{{AUR|pywinery}}}}<br />
* {{App|Q4Wine|Graphical prefix manager for Wine. Can export [[Qt]] themes into the Wine configuration for better integration.|https://sourceforge.net/projects/q4wine/|{{AUR|q4wine}}}}<br />
<br />
== Configuration ==<br />
Configuring Wine is typically accomplished using:<br />
* [https://wiki.winehq.org/Winecfg winecfg] is a GUI configuration tool for Wine, which can be started by running {{ic|winecfg}}.<br />
* [https://wiki.winehq.org/Regedit regedit] is Wine's registry editing tool, which can be started by running {{ic|regedit}}. See WineHQ's article on [https://wiki.winehq.org/Useful_Registry_Keys Useful Registry Keys].<br />
* [https://wiki.winehq.org/Control control] is Wine's implementation of the Windows Control Panel, which can be started by running {{ic|wine control}}.<br />
* See WineHQ's [https://wiki.winehq.org/List_of_Commands List of Commands] for the full list.<br />
<br />
=== WINEPREFIX ===<br />
By default, Wine stores its configuration files and installed Windows programs in {{ic|~/.wine}}. This directory is commonly called a "Wine prefix" or "Wine bottle". It is created/updated automatically whenever you run a Windows program or one of Wine's bundled programs such as ''winecfg''. The prefix directory also contains a tree which your Windows programs will see as {{ic|C:}} (the C-drive).<br />
<br />
You can override the location Wine uses for a prefix with the {{ic|WINEPREFIX}} [[environment variable]]. This is useful if you want to use separate configurations for different Windows programs. The first time a program is run with a new Wine prefix, Wine will automatically create a directory with a bare C-drive and registry.<br />
<br />
For example, if you run one program with {{ic|1= $ env WINEPREFIX=~/.win-a wine program-a.exe}}, and another with {{ic|1= $ env WINEPREFIX=~/.win-b wine program-b.exe}}, the two programs will each have a separate C-drive and separate registries.<br />
<br />
{{Note|Wine prefixes are not [[Wikipedia:Sandbox (computer security)|sandboxes]]! Programs running under Wine can still access the rest of the system! (for example, {{ic|Z:}} is mapped to {{ic|/}}, regardless of the Wine prefix).}}<br />
<br />
To create a default prefix without running a Windows program or other GUI tool you can use:<br />
$ env WINEPREFIX=~/.customprefix wineboot -u<br />
<br />
=== WINEARCH ===<br />
<br />
Wine will start an 64-bit environment by default. You can change this behavior using the {{ic|WINEARCH}} [[environment variable]]. Rename your {{ic|~/.wine}} directory and create a new Wine environment by running {{ic|1=$ WINEARCH=win32 winecfg}}. This will get you a 32-bit Wine environment. Not setting {{ic|WINEARCH}} will get you a 64-bit one.<br />
<br />
You can combine this with {{ic|WINEPREFIX}} to make a separate {{ic|win32}} and {{ic|win64}} environment:<br />
<br />
$ WINEARCH=win32 WINEPREFIX=~/win32 winecfg<br />
$ WINEPREFIX=~/win64 winecfg<br />
<br />
You can also use {{ic|WINEARCH}} in combination with other Wine programs, such as ''winetricks'' (using Steam as an example):<br />
<br />
WINEARCH=win32 WINEPREFIX=~/.local/share/wineprefixes/steam winetricks steam<br />
<br />
=== Graphics drivers ===<br />
<br />
You need to install the 32-bit version of your graphics driver. Please install the package that is listed in the ''OpenGL (multilib)'' column in the table in [[Xorg#Driver installation]].<br />
<br />
A good sign that your drivers are inadequate or not properly configured is when Wine reports the following in your terminal window:<br />
Direct rendering is disabled, most likely your OpenGL drivers have not been installed correctly<br />
<br />
{{Note|You might need to restart X after having installed the correct library.}}<br />
<br />
=== Sound ===<br />
<br />
By default sound issues may arise when running Wine applications. Ensure only one sound device is selected in ''winecfg''.<br />
<br />
* If you want to use the [[ALSA]] driver in Wine, you will need to install {{Pkg|lib32-alsa-lib}} and {{Pkg|lib32-alsa-plugins}}.<br />
* If you want to use the [[PulseAudio]] driver in Wine, you will need to install the {{Pkg|lib32-libpulse}} package.<br />
* If you want to use the [[OSS]] driver in Wine, you will need to install the {{Pkg|lib32-alsa-oss}} package. The OSS driver in the kernel will not suffice.<br />
* Games that use advanced sound systems (''e.g.'' TESV: Skyrim) may additionally require installations of {{Pkg|lib32-openal}}.<br />
<br />
If ''winecfg'' '''still''' fails to detect the audio driver (Selected driver: (none)), [https://www.winehq.org/docs/wineusr-guide/using-regedit#Configuring_Sound configure it via the registry]. For example, in a case where the microphone was not working in a 32-bit Windows application on a 64-bit stock install of wine-1.9.7, this provided full access to the sound hardware (sound playback and mic): open ''regedit'', look for the key HKEY_CURRENT_USER → Software → Wine → Drivers, and add a string called ''Audio'' and give it the value ''alsa''. Also, it may help to [[#WINEARCH|recreate the prefix]]. <br />
<br />
==== MIDI support ====<br />
<br />
[[MIDI]] was a quite popular system for video games music in the 90's. If you are trying out old games, it is not uncommon that the music will not play out of the box.<br />
Wine has excellent MIDI support. However you first need to make it work on your host system, as explained in [[MIDI]]. Last but not least you need to make sure Wine will use the correct MIDI output.<br />
<br />
=== Other libraries ===<br />
<br />
*Some applications (e.g. Office 2003/2007) require the MSXML library to parse HTML or XML, in such cases you need to install {{Pkg|lib32-libxml2}}.<br />
<br />
*Some applications that play music may require {{Pkg|lib32-mpg123}}.<br />
<br />
*Some applications that use a color management engine (e.g. pdf viewers, image viewers, etc) may require {{Pkg|lib32-lcms2}}.<br />
<br />
*Some applications that use native image manipulation libraries may require {{Pkg|lib32-giflib}} and {{Pkg|lib32-libpng}}.<br />
<br />
*Some applications that require encryption support may require {{Pkg|lib32-gnutls}}.<br />
<br />
*Some applications require 32-bit video codecs or the program crashes. Install {{Pkg|lib32-gst-plugins-base}}, {{Pkg|lib32-gst-plugins-good}}, {{Aur|lib32-gst-plugins-bad}} and {{Aur|lib32-gst-plugins-ugly}}.<br />
<br />
=== Fonts ===<br />
<br />
If Wine applications are not showing easily readable fonts, you may not have any fonts installed. To easily link all of the system fonts so they are accessible from wine:<br />
<br />
cd ${WINEPREFIX:-~/.wine}/drive_c/windows/Fonts && for i in /usr/share/fonts/**/*.{ttf,otf}; do ln -s "$i" ; done<br />
<br />
Wine uses freetype to render fonts, and freetype's defaults changed a few releases ago. Try using this environment setting for wine programs:<br />
<br />
FREETYPE_PROPERTIES="truetype:interpreter-version=35"<br />
<br />
Another possibility is to install Microsoft's Truetype fonts into your wine prefix. See [[MS Fonts]]. If this does not help, try running {{ic|winetricks corefonts}} first, then {{ic|winetricks allfonts}} as a last resort.<br />
<br />
After running such programs, kill all Wine servers and run {{ic|winecfg}}. Fonts should be legible now.<br />
<br />
If the fonts look somehow smeared, import the following text file into the Wine registry with [https://wiki.winehq.org/FAQ#How_do_I_edit_the_Wine_registry.3F regedit]:<br />
<br />
Windows Registry Editor Version 5.00<br />
[HKEY_CURRENT_USER\Software\Wine\X11 Driver]<br />
"ClientSideWithRender"="N"<br />
<br />
For high resolution displays, you can adjust dpi values in winecfg.<br />
<br />
See also [[Font configuration#Applications without fontconfig support]].<br />
<br />
==== Enable font smoothing ====<br />
A good way to improve wine font rendering is to enable cleartype font smoothing.<br />
To enable "Subpixel smoothing (ClearType) RGB":<br />
<br />
{{bc|<nowiki>cat << EOF > /tmp/fontsmoothing<br />
REGEDIT4<br />
<br />
[HKEY_CURRENT_USER\Control Panel\Desktop]<br />
"FontSmoothing"="2"<br />
"FontSmoothingOrientation"=dword:00000001<br />
"FontSmoothingType"=dword:00000002<br />
"FontSmoothingGamma"=dword:00000578<br />
EOF<br />
<br />
WINE=${WINE:-wine} WINEPREFIX=${WINEPREFIX:-$HOME/.wine} $WINE regedit /tmp/fontsmoothing 2> /dev/null</nowiki>}}<br />
<br />
For more information, check [https://askubuntu.com/a/219795/514682 the original answer]<br />
<br />
=== Desktop launcher menus ===<br />
<br />
When a Windows application installer creates a shortcut Wine creates a {{ic|.desktop}} file instead. The default locations for those files in Arch Linux are:<br />
* Desktop shortcuts are put in {{ic|~/Desktop}}<br />
* Start menu shortcuts are put in {{ic|~/.local/share/applications/wine/Programs/}}<br />
<br />
{{Note|1=Wine does not support installing Windows applications for all users, so it will not put {{ic|.desktop}} files in {{ic|/usr/share/applications}}. See WineHQ bug [https://bugs.winehq.org/show_bug.cgi?id=11112 11112]}}<br />
<br />
{{Tip|If menu items were ''not'' created while installing software or have been lost, {{ic|wine winemenubuilder}} may be of some use.}}<br />
<br />
==== Creating menu entries for Wine utilities ====<br />
<br />
By default, installation of Wine does not create desktop menus/icons for the software which comes with Wine (e.g. for ''winecfg'', ''winebrowser'', etc). This can be achieved by installing {{AUR | wine-installer}}, otherwise these instructions will add entries for these applications.<br />
<br />
First, install a Windows program using Wine to create the base menu. After the base menu is created, you can create the following files in {{ic|~/.local/share/applications/wine/}}:<br />
<br />
{{hc|wine-browsedrive.desktop|2=<br />
[Desktop Entry]<br />
Name=Browse C: Drive<br />
Comment=Browse your virtual C: drive<br />
Exec=wine winebrowser c:<br />
Terminal=false<br />
Type=Application<br />
Icon=folder-wine<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-uninstaller.desktop|2=<br />
[Desktop Entry]<br />
Name=Uninstall Wine Software<br />
Comment=Uninstall Windows applications for Wine<br />
Exec=wine uninstaller<br />
Terminal=false<br />
Type=Application<br />
Icon=wine-uninstaller<br />
Categories=Wine;<br />
}}<br />
<br />
{{hc|wine-winecfg.desktop|2=<br />
[Desktop Entry]<br />
Name=Configure Wine<br />
Comment=Change application-specific and general Wine options<br />
Exec=winecfg<br />
Terminal=false<br />
Icon=wine-winecfg<br />
Type=Application<br />
Categories=Wine;<br />
}}<br />
<br />
And create the following file in {{ic|~/.config/menus/applications-merged/}}:<br />
<br />
{{hc|wine.menu|<nowiki><br />
<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"<br />
"http://www.freedesktop.org/standards/menu-spec/menu-1.0.dtd"><br />
<Menu><br />
<Name>Applications</Name><br />
<Menu><br />
<Name>wine-wine</Name><br />
<Directory>wine-wine.directory</Directory><br />
<Include><br />
<Category>Wine</Category><br />
</Include><br />
</Menu><br />
</Menu><br />
</nowiki>}}<br />
<br />
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 settings 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 [http://www.gnome-look.org/content/show.php/GNOME-colors?content=82562 GNOME-colors].<br />
<br />
==== Removing menu entries ====<br />
<br />
Menu entries created by Wine are located in {{ic|~/.local/share/applications/wine/Programs/}}. Remove the program's ''.desktop'' entry to remove the application from the menu.<br />
<br />
In addition to remove unwanted extensions binding by Wine, execute the following commands (taken from the Wine website):<br />
$ rm ~/.local/share/mime/packages/x-wine*<br />
$ rm ~/.local/share/applications/wine-extension*<br />
$ rm ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
$ rm ~/.local/share/mime/application/x-wine-extension*<br />
<br />
=== Appearance ===<br />
<br />
A similar to XP looking theme can be downloaded from [http://download.microsoft.com/download/e/a/9/ea9af5ae-b48e-473e-85fe-dcde7472e644/ZuneDesktopTheme.msi here]. To install it see [https://wiki.winehq.org/Wine_User%27s_Guide#Running_.msi_files here]. Lastly use ''winecfg'' to select it.<br />
Wine staging users may instead want to try enabling the option ''Enable GTK3 Theming'' under the Staging section of ''winecfg'' for a theme that matches the current GTK+ theme.<br />
<br />
=== Printing ===<br />
<br />
In order to use your installed printers (both local and network) with wine applications in ''win32 prefixes'' (e.g. MS Word), install the {{Pkg|lib32-libcups}} package, reboot wine (''wineboot'') and restart your wine application.<br />
<br />
== Usage ==<br />
<br />
{{Warning|Do not run or install Wine applications as root! See [https://wiki.winehq.org/FAQ#Should_I_run_Wine_as_root.3F Wine FAQ] for details.}}<br />
<br />
See [https://wiki.winehq.org/FAQ Wine FAQ] and [https://wiki.winehq.org/Wine_User%27s_Guide Wine User's Guide] for general information on Wine usage.<br />
<br />
See [https://appdb.winehq.org/ Wine Application Database (AppDB)] for information on running Windows applications in Wine.<br />
<br />
== Tips and tricks ==<br />
<br />
=== Wineconsole ===<br />
<br />
Often you may need to run ''.exe'''s to patch game files, for example a widescreen mod for an old game, and running the ''.exe'' normally through Wine might yield nothing happening. In this case, you can open a terminal and run the following command:<br />
<br />
$ wineconsole cmd<br />
<br />
Then navigate to the directory and run the ''.exe'' file from there.<br />
<br />
=== Winetricks ===<br />
<br />
[https://wiki.winehq.org/Winetricks Winetricks] is a script to allow one to install base requirements needed to run Windows programs. Installable components include DirectX 9.x, MSXML (required by Microsoft Office 2007 and Internet Explorer), Visual Runtime libraries and many more.<br />
<br />
[[Install]] the {{pkg|winetricks}} package (or alternatively {{AUR|winetricks-git}}). Then run it with:<br />
$ winetricks<br />
<br />
=== Performance ===<br />
<br />
==== CSMT ====<br />
<br />
CSMT is a technology used by Wine to use a separate thread for the OpenGL calls to improve performance noticeably. Since Wine 3.2, CSMT is enabled by default. However, CSMT support needs to be enabled manually for Wine versions lower than 3.2. For vanilla Wine run {{ic|wine regedit}} and set the DWORD value for ''HKEY_CURRENT_USER -> Software > Wine > Direct3D > csmt'' to 0x01 (enabled). For wine-staging run {{ic|winecfg}} and enable it in the staging tab.<br />
<br />
Note that CSMT may actually hurt performance for some applications - if this is the case, disable it by creating/setting the registry value to 0x00 (disabled).<br />
<br />
Further information:<br />
*[http://www.phoronix.com/forums/showthread.php?93967-Wine-s-Big-Command-Stream-D3D-Patch-Set-Updated/page3&s=7775d7c3d4fa698089d5492bb7b1a435 Phoronix Forum discussion] with the CSMT developer Stefan Dösinger<br />
<br />
==== Force OpenGL mode in games ====<br />
<br />
Some games might have an OpenGL mode which ''may'' perform better than their default DirectX mode. While the steps to enable OpenGL rendering is ''application specific'', many games accept the {{Ic|-opengl}} parameter.<br />
$ wine ''/path/to/3d_game.exe'' -opengl<br />
<br />
You should of course refer to your application's documentation and Wine's [http://appdb.winehq.org AppDB] for such application specific information.<br />
<br />
==== DXVK ====<br />
[https://github.com/doitsujin/dxvk DXVK] is a promising new implementation for DirectX 10 and DirectX 11 over Vulkan. This should allow for greater performance, and in some cases, even better compatibility. Battlefield 1 for example, only runs under DXVK. On the other hand, DXVK does not support all Wine games (yet).<br />
<br />
To use it, install {{aur|dxvk-bin}} for official binaries, or {{aur|dxvk-git}}{{Broken package link|package not found}} for the development version. Then run the following command to activate it in your Wineprefix (by default {{ic|~/.wine}}):<br />
$ WINEPREFIX=''your-prefix'' setup_dxvk64<br />
<br />
Use {{ic|setup_dxvk32}} for 32-bit applications.<br />
<br />
{{note|For Wine versions below 3.5 you need to configure Vulkan support manually, following the instructions at [https://github.com/roderickc/wine-vulkan GitHub]. {{Pkg|wine}} and {{Pkg|wine-staging}} work out of the box.}}<br />
<br />
{{warning|DXVK overrides the DirectX 10 and 11 DLLs, which may be considered cheating in online multiplayer games, and may get your account '''banned'''. Use at your own risk!}}<br />
<br />
==== Gallium Nine ====<br />
<br />
With the open-source gallium-based drivers (mostly AMD cards) there is a [https://wiki.ixit.cz/d3d9 Gallium Direct3D state tracker] that aims to provide nearly-native performance for DirectX 9. In most cases it has less visual glitches than the upstream wine and doubles the performances. It consumes much less CPU time than CSMT.<br />
<br />
To use it, install {{Pkg|wine-nine}}. This is a standalone package that can be installed with any wine version. You may need to enable it with {{ic|wine ninewinecfg.exe}} found in the {{ic|/usr/lib32/wine/fakedlls/}} directory.<br />
<br />
=== Unregister existing Wine file associations ===<br />
<br />
By default, Wine takes over as the default application for a lot of formats. Some (e.g. {{ic|vbs}} or {{ic|chm}}) are Windows-specific, and opening them with Wine can be a convenience. However, having other formats (e.g. {{ic|gif}}, {{ic|jpeg}}, {{ic|txt}}, {{ic|js}}) open in Wine's bare-bones simulations of Internet Explorer and Notepad can be annoying.<br />
<br />
Wine's file associations are set in {{ic|~/.local/share/applications/}} as {{ic|wine-extension-''extension''.desktop}} files. Delete the files corresponding to the extensions you want to unregister. Or, to remove all wine extensions:<br />
<br />
$ rm -f ~/.local/share/applications/wine-extension*.desktop<br />
$ rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*<br />
<br />
Next, remove the old cache:<br />
<br />
$ rm -f ~/.local/share/applications/mimeinfo.cache<br />
$ rm -f ~/.local/share/mime/packages/x-wine*<br />
$ rm -f ~/.local/share/mime/application/x-wine-extension*<br />
<br />
And, update the cache:<br />
<br />
$ update-desktop-database ~/.local/share/applications<br />
$ update-mime-database ~/.local/share/mime/<br />
<br />
Alternatively you can delete all wine related stuff:<br />
<br />
$ find ~/.local/share -name "*wine*" | xargs -I '{}' --no-run-if-empty rm -r '{}'<br />
<br />
And update the cache as above.<br />
<br />
Please note Wine will still create new file associations and even recreate the file associations if the application sets the file associations again.<br />
<br />
=== Prevent new Wine file associations ===<br />
<br />
Prevent wine from creating any file associations by editing the registry:<br />
<br />
{{hc|1=associations.reg|2=<br />
Windows Registry Editor Version 5.00<br />
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunServices]<br />
"winemenubuilder"="C:\\windows\\system32\\winemenubuilder.exe -r"<br />
}}<br />
<br />
Add this to your Wine registry, by running {{ic|wine regedit associations.reg}}, or alternatively by running {{ic|wine regedit}} and importing it from the menu in ''Registry > Import Registry File''.<br />
<br />
This has to be done for each WINEPREFIX which should not update file associations.<br />
<br />
You can disable winemenubuilder for all WINEPREFIXes by setting an environment variable:<br />
<br />
$ export WINEDLLOVERRIDES="winemenubuilder.exe=d"<br />
<br />
=== Execute Windows binaries with Wine implicitly ===<br />
<br />
The {{pkg|wine}} package installs a ''binfmt'' file which will allow you to run Windows programs directly, e.g. {{ic|''./myprogram.exe''}} will launch as if you had typed {{ic|wine ''./myprogram.exe''}}. All you have to do in order to use this is to [[start]]/[[enable]] {{ic|systemd-binfmt.service}}.<br />
<br />
{{Note|Make sure the Windows binary is executable, otherwise the binary will not be executed: e.g. run {{ic|chmod +x ''windows-binary''}}.}}<br />
<br />
=== Dual Head with different resolutions ===<br />
<br />
If you have issues with dual-head setups and different display resolutions you are probably missing {{Pkg|lib32-libxrandr}}.<br />
<br />
Also installing {{Pkg|lib32-libxinerama}} might fix dual-head issues with wine (for example, unclickable buttons and menus of application in the right most or bottom most monitor, not redrawable interface of application in that zone, dragging mouse cursor state stucked after leaving application area).<br />
<br />
=== Burning optical media ===<br />
<br />
To burn CDs or DVDs, you will need to load the {{ic|sg}} [[kernel module]].<br />
<br />
=== Proper mounting of optical media images ===<br />
<br />
Some applications will check for the optical media to be in drive. They may check for data only, in which case it might be enough to configure the corresponding path as being a CD-ROM drive in ''winecfg''.<br />
However, other applications will look for a media name and/or a serial number, in which case the image has to be mounted with these special properties.<br />
<br />
Some virtual drive tools do not handle these metadata, like fuse-based virtual drives (Acetoneiso for instance). CDEmu will handle it correctly.<br />
<br />
=== Show FPS overlay in games ===<br />
<br />
Wine features an embedded FPS monitor which works for all graphical applications if the environment variable {{ic|1=WINEDEBUG=fps}} is set. This will output the framerate to stdout. You can display the FPS on top of the window thanks to {{ic|osd_cat}} from the {{pkg|xosd}} package. See [https://gist.github.com/anonymous/844aefd70bb50bf72b35 winefps.sh] for a helper script.<br />
<br />
=== Running Wine under a separate user account ===<br />
<br />
It may be desirable to run Wine under a specifically created user account in order to reduce concerns about Windows applications having access to your home directory.<br />
<br />
First, create a [[user account]] for Wine:<br />
<br />
# useradd -m -s /bin/bash wineuser<br />
<br />
Now switch to another TTY and start your X WM or DE as you normally would or keep reading...<br />
<br />
{{Note|The following approach only works when enabling root for Xorg. See [[Xorg#Rootless Xorg]] for more information.}}<br />
<br />
Afterwards, in order to open Wine applications using this new user account you need to add the new user to the X server permissions list:<br />
<br />
$ xhost +SI:localuser:wineuser<br />
<br />
Finally, you can run Wine via the following command, which uses {{ic|env}} to launch Wine with the environment variables it expects:<br />
<br />
$ sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine ''arguments''<br />
<br />
It is possible to automate the process of running Windows applications with Wine via this method by using a shell script as follows:<br />
{{hc|1=/usr/local/bin/runaswine|2=<br />
#!/bin/bash<br />
xhost +SI:localuser:wineuser<br />
sudo -u wineuser env HOME=/home/wineuser USER=wineuser USERNAME=wineuser LOGNAME=wineuser wine "$@"}}<br />
<br />
Wine applications can then be launched via:<br />
<br />
$ runaswine ''"C:\path\to\application.exe"''<br />
<br />
In order to not be asked for a password each time Wine is run as another user the following entry can be added to the sudoers file: {{ic|1=''mainuser'' ALL=(wineuser) NOPASSWD: ALL}}. See [[Sudo#Configuration]] for more information.<br />
<br />
It is recommended to run {{ic|winecfg}} as the Wine user and remove all bindings for directories outside the home directory of the Wine user in the "Desktop Integration" section of the configuration window so no program run with Wine has read access to any file outside the special user's home directory.<br />
<br />
Keep in mind that audio will probably be non-functional in Wine programs which are run this way if [[PulseAudio]] is used. See [[PulseAudio/Examples#Allowing multiple users to use PulseAudio at the same time]] for information about allowing the Wine user to access the PulseAudio daemon of the principal user.<br />
<br />
=== Temp directory on tmpfs ===<br />
<br />
To prevent Wine from writing its temporary files to a physical disk, one can define an alternative location, like ''tmpfs''. Remove Wine's default directory for temporary files and creating a symlink:<br />
<br />
$ rm -r ~/.wine/drive_c/users/$USER/Temp<br />
$ ln -s /tmp/ ~/.wine/drive_c/users/$USER/Temp<br />
<br />
=== Prevent installing Mono/Gecko ===<br />
If Gecko and/or Mono are not present on the system nor in the Wine prefix, Wine will prompt to download them from the internet. If you do not need Gecko and/or Mono, you might want to disable this dialog, by setting the {{ic|WINEDLLOVERRIDES}} [[environment variable]] to {{ic|1=mscoree=d;mshtml=d}}.<br />
<br />
=== Vulkan ===<br />
Vulkan support is included, since Wine 3.3. The default Wine Vulkan ICD loader works fine for most applications, but does not support advanced features, like Vulkan layers. To use these features, you have to install the official Vulkan SDK, see step 2-4 on the original Vulkan patches author's [https://github.com/roderickc/wine-vulkan GitHub page].<br />
<br />
{{note|The Wine ICD loader was added in Wine 3.5, you need to install the official Vulkan SDK to use Vulkan in Wine 3.3 and 3.4}}<br />
<br />
=== Remove Wine file bindings ===<br />
For security reasons it may be useful to remove the preinstalled Wine bindings so Windows applications can't be launched directly from a file manager or from the browser (Firefox offers to open EXE files directly with Wine!).<br />
If you want to do this, you may add the following to the {{ic|1= [options]}} section in {{ic|1= /etc/pacman.conf}}<br />
<br />
NoExtract = usr/lib/binfmt.d/wine.conf<br />
NoExtract = usr/share/applications/wine.desktop<br />
<br />
== See also ==<br />
<br />
* [https://www.winehq.org/ Wine Homepage]<br />
* [https://wiki.winehq.org/ Wine Wiki]<br />
* [https://appdb.winehq.org/ Wine Application Database (AppDB)] - Information about running specific Windows applications (Known issues, ratings, guides, etc tailored to specific applications)<br />
* [https://forum.winehq.org/ Wine Forums] - A great place to ask questions ''after'' you have looked through the FAQ and AppDB<br />
* [https://wiki.gentoo.org/wiki/Wine Wine - Gentoo Wiki]</div>RedTide