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

Difference between revisions of "Wine"

From PCGamingWiki, the wiki about fixing PC games
m (→‎Homebrew: fix closing <code> section)
Line 3: Line 3:
 
To achieve this goal, Wine duplicates functions of the Windows operating system by providing both alternative implementations of the DLLs that Windows programs call and a process to substitute the Windows NT kernel.
 
To achieve this goal, Wine duplicates functions of the Windows operating system by providing both alternative implementations of the DLLs that Windows programs call and a process to substitute the Windows NT kernel.
  
''Note that it is recommended that you have at least basic knowledge of the Terminal/shell before using Wine. If you do not and are using OS X, then try [[Wine#Wineskin|Wineskin]].''
+
''Note that it is recommended that you have at least basic knowledge of the Terminal/shell before using Wine. If you do not then try [[Wine#PlayOnLinux/PlayOnMac|PlayOnLinux/PlayOnMac]] for both Linux and Mac or [[Wine#Wineskin|Wineskin]] for OS X.''
  
 
== Linux ==
 
== Linux ==
Line 146: Line 146:
  
 
Basic information on how to use winetricks is [http://wiki.winehq.org/winetricks available on the Wine Wiki].
 
Basic information on how to use winetricks is [http://wiki.winehq.org/winetricks available on the Wine Wiki].
 +
 +
== PlayOnLinux/PlayOnMac ==
 +
PlayOnLinux and PlayOnMac (referred to as [[PlayOn]] in this Wiki as both pieces of software are exactly the same and just refer to the operating system they run on) is a graphical-front end for Wine that provides wrapper shell scripts which specify the configuration of Wine in order to install and run a particular application. Using PlayOn is an easy way to use the functionality of Wine without having to worry about its complexity.
 +
  
 
== General Information ==
 
== General Information ==

Revision as of 19:53, 26 January 2013

Wine is a free and open source software application that aims to allow computer programs written for Windows to run on Linux and Mac.

To achieve this goal, Wine duplicates functions of the Windows operating system by providing both alternative implementations of the DLLs that Windows programs call and a process to substitute the Windows NT kernel.

Note that it is recommended that you have at least basic knowledge of the Terminal/shell before using Wine. If you do not then try PlayOnLinux/PlayOnMac for both Linux and Mac or Wineskin for OS X.

Linux

Installation

To install Wine on your Linux distribution, check your package manager. Most Linux distros DON'T come with Wine pre-installed, but it can be installed just with a single command or a few clicks depending of the distro. Google doesn't bite! most instructions for ANY distro can be found by googling "wine in [your distro's name and version]".

Be aware that the latest version of Wine won't be always the best performing version. Check the Wine appdb for detailed instructions, info and know bugs for your application.

A nice complement is playonlinux; this application installs automagically of a good number of games and other apps like Microsoft Office and Photoshop. Look up here for a full list of supported applications.

Ubuntu/Linux Mint

(for versions 10.04 to 12.10)

To get the latest Wine release, copy and paste the following lines; one by one in a terminal window. Older releases can be found in the repository.

add-apt-repository ppa:ubuntu-wine/ppa && sudo apt-get update

This adds the PPA repository of Wine to your system and update the repository's database.


sudo apt-get install wine1.5 winetricks

This command installs wine 1.5 and winetricks

Fedora

Login as root, then run: yum install wine

It's as simple as that.

Mac

Installation

Wine requires Xcode, which can be downloaded and installed via the Mac App Store on OS X 10.6 and above, or via the Apple Developer downloads section.

MacPorts is also required, which can be download and installed from http://www.macports.org/. It then needs to be configured by entering the following two commands into the Terminal:

echo export PATH=/opt/local/bin:/opt/local/sbin:\$PATH$'\n'export MANPATH=/opt/local/man:\$MANPATH | sudo tee -a /etc/profile

if [ `sysctl -n hw.cpu64bit_capable` -eq 1 ] ; then echo "+universal" | sudo tee -a /opt/local/etc/macports/variants.conf; else echo "not 64bit capable"; fi

After this, you may need to agree to the Xcode license, which you can do so by running the following in the Terminal:

sudo xcodebuild -license

Then enter "agree" before closing and reopening the Terminal window.

Now you need to install Wine using MacPorts, by entering the following command (which may take several hours to do):

sudo port install wine

And then Wine will be installed and ready to use!

Homebrew

Homebrew is similar to MacPorts in that the source code to programs is downloaded and compiled. However, Homebrew opts to use the built-in libraries already available as part of the default Mac OS X installation, rather than compiling new versions. This can save time and disk space.

You will, like MacPorts, need XCode to install the required compilers and header files.

Wine is available via Homebrew and can be installed (along with Winetricks) via:

brew install wine winetricks

Making a Dock Icon

To make a dock icon for a Wine program we need to write a program in AppleScript that launches the Windows program. Open the script editor that came with your OS (which can be found in the /Applications/Utilities directory of the computer and is called something like "Script Editor" or "AppleScript Editor" depending on your OS version).

Within the script editor enter the following (where $PATH_TO_PROGRAM is the path from the Program Files directory to your .exe file and TAB is a press of the tab button):

tell application "Terminal"

TABdo script "/opt/local/bin/wine ~/.wine/drive_c/Program\\ Files/$PATH_TO_PROGRAM.exe"

end tell

Then press "Compile" and save the script where you like (making sure to select the "File Format: Application" in the save options, and leaving "Startup Screen" unchecked). Open up the Finder, go to where you saved the script and then drag the file to your Dock, where it will stay. You can then click on that Dock Icon to open up your Windows program.

Updating

To keep Wine up-to-date, it is recommended to run the following command every few months or so via the Terminal/shell:

sudo port selfupdate && sudo port upgrade outdated

Uninstalling

To uninstall both Wine and MacPorts, simply run the following command in the Terminal:

sudo rm -rf /opt ~/.wine /Applications/MacPorts

To uninstall just Wine, simply run the following command in the Termianl/shell:

sudo port uninstall wine

Wineskin

Wineskin is a program based on Wine that acts as a GUI interface, so that the Terminal/shell does not have to be used.

Installing Windows Programs

Go to the directory where the Windows .exe installed file is in the Terminal/shell and then enter the following command (where INSTALLED.exe is the name of the .exe file):

wine $INSTALLER.exe

A regular graphical Windows installer will soon appear, which you can click through to complete the installation.

Running Windows Programs

Open the Terminal/shell and go to your Program Files folder via the following command:

cd ~/.wine/drive_c/Program\ Files/

Run ls to see what Windows programs you have installed. To run a program enter its directory by using cd DIRECTORY_NAME (where DIRECTORY_NAME is the name of the directory with the program that you want to run. Within that directory there should be an .exe file which you can run with the following command (where PROGRAM.exe is the name of the .exe file):

wine $PROGRAM.exe

The program will soon appear, ready to use.

Common Issues

.NET/Mono

Some Windows applications require the .NET software framework to run (Wine will instruct you to install if an application you try to run requires it), which is not compatible with Wine. However, an open source piece of software called Mono was made to replace it. You can install it via installing winetricks and entering this line into the Terminal/shell:

winetricks mono210

D-bus (Mac)

Some Windows applications require the D-bus process to run, in order to communicate with certain other applications. While it is installed along-side Macports, it will not run unless you tell it to. You only need to do this once, and then the process will run every time on startup:

sudo launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist

launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist

AppDB

The Wine Application Database ("AppDB") gives help on installing and running specific Windows programs with Wine.

Tweaking Wine

Winecfg

Winecfg is a GUI (graphical user interface) configuration tool for Wine. It allows you to change options for both the default setting and for specific applications. These options include the way Wine loads DLLs, graphical settings (including Window settings, screen resolution/DPI), desktop integration, drives and audio).

The tool can be accessed with the command:

$ winecfg

A run down on the different tabs of Winecfg is available on the Wine Wiki.

Winetricks

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

Basic information on how to use winetricks is available on the Wine Wiki.

PlayOnLinux/PlayOnMac

PlayOnLinux and PlayOnMac (referred to as PlayOn in this Wiki as both pieces of software are exactly the same and just refer to the operating system they run on) is a graphical-front end for Wine that provides wrapper shell scripts which specify the configuration of Wine in order to install and run a particular application. Using PlayOn is an easy way to use the functionality of Wine without having to worry about its complexity.


General Information

The Wine Website

The Wine Wiki

The Wine Wikipedia Page