Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "Wine"

From PCGamingWiki, the wiki about fixing PC games
m
Line 111: Line 111:
 
[[Category:Hack]]
 
[[Category:Hack]]
 
[[Category:Wine]]
 
[[Category:Wine]]
 +
[[Category:Emulation]]<!-- arguable, but it puts it in categories so people can find it easier -->

Revision as of 16:36, 10 May 2012

Wine is a free and open source software application that aims to allow computer programs written for Windows to run on Unix-like operating systems.

Difference between emulation and wine

Wine does not stand for "Windows Emulator", it specifically stands for "Wine is not an Emulator"

An emulator slows execution by emulating hardware with software, wine creates duplicate libraries which link through to native functions in your operating system of choice.

When a game asks DirectX to render a circle, the function it is accessing is actually a similarly named Wine function. This function then tells OpenGL to render a circle. This overhead is minimal, and is often offset by alternative operating systems not requiring anti-virus programs or firewalls, and their lesser bloat.

Mac usage

Mac users can download and install Wine using MacPorts.

A detailed tutorial for Mac download, installation and usage can be found at davidbaumgold.com.

GUI applications

There are also GUI applications for those who do not want to get into the nitty-gritty of terminal-based computing:

  • Wineskin is an easy to use application, that created applications with simple a simple installer for Windows programs. Most, if not all, gamers can get away with simply using Wineskin.

Tutorial

This is a beginners guide on getting Windows programs to run in Wine, some games may require manual compilation or other tweaks.

The techniques listed here are designed for Linux, but other operating systems such as Mac OS X can implement them in much the same way.

Note that several programs can be installed and run with tools such as PlayOnLinux, but this tutorial will teach you to do things manually, which comes in handy if the tools do not support a game, or do not work properly.

Linux installation

While most Linux distributions come with a version of Wine, more often than not you'll want to use a bleeding edge version to get newer games working.

You can download the source code and compile it yourself, or download a pre-compiled version from PlayOnLinux. Unless specifically stated otherwise, you should use a 32-bit version of wine.

Starter script

The following script can be used as a base to launch windows applications in wine.

#!/bin/bash

PATH="/home/$USER/wine/versions/1.3.24/bin:$PATH"
# This line prefixes a directory to your $PATH. Basically, when you run a command like "wine"
# it will look in that folder to run it. This lets you use different wine versions for different games.
# Replace the directory with whatever is the location of your wine version's binary files

export WINEPREFIX="/home/$USER/wine/prefixes/mygame"
# Every prefix contains it's own settings, it's own installed programs, and it's own "Hard drive"
# This allows you to install different games with widely ranging settings, without messing up other ones.

export WINEDEBUG="-all"
# This option should be disabled during install, or debugging. It stops wine from outputting errors, which
# can increase performance as there are often large amounts of data it attempts to output.

cd "$WINEPREFIX/drive_c/Program Files/mygame"
# Change to the directory your game is installed in

wine mygame.exe
# And run it in wine

# Other things you may want to keep in the file for convenience

#winecfg
# This allows you to configure the prefix, set up video settings, audio settings, and other options

#wineserver -k
# This will terminate all processes on the wineprefix, nice for stopping uncooperative windows programs.

#winetricks
# Winetricks is used for many tweaks to wine, which you will probably be using for some of the games you install.

Make sure to make the script executable before you try to run it:

$ chmod +x script

Tweaks

Several tweaks to wine can provide functionality ranging from the .NET framework to Internet Explorer.

Wine versions

A list of precompiled versions of Wine is available at PlayOnLinux

Later versions are supposed to be "Unstable" - however, later versions are usually required to get newer games to work.

If a game doesn't work with a specific version of Wine, try a different one.

Winecfg

This is the default wine configuration tool, and allows you to change options ranging from the version of Windows, to the graphical capabilities, to the virtual hard drives in use by the prefix.

The tool can be accessed with the command:

$ winecfg

Winetricks

Winetricks is a script that automatically downloads, installs, and configures many tools for Wine. It also contains scripts to automatically install games.

Installation instructions can be found at the wine wiki.

Use is very simple.

winetricks -h          # Help menu
winetricks ie6         # Installs internet explorer 6
winetricks mwo=force   # Forces mouse warp (For first person shooters where the mouse escapes the window)
winetricks vcrun2010   # Installs Visual C++ 2010 libraries 
winetricks dotnet35    # Installs .NET 3.5

Manual compilation

The most advanced tweak is to manually download the source code, patch it, and compile it.

This last-ditch-effort allows you to run games that simply don't work with wine without alterations to the source code.

Compilation takes quite a while, and is very complicated, so I will only make one alteration to the pre-existing tutorials.

When you run the configure script, give it a prefix, that way it will be compiled to it's own folder, ready to be used in the script above.

$ ./configure --prefix=/home/$USER/wine/versions/custombuild