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
Line 1: Line 1:
Wine is a free and open source software application that aims to allow computer programs written for [[Microsoft Windows|Windows]] to run on Unix-like operating systems.
+
Wine is a free and open source software application that aims to allow computer programs written for [[Microsoft Windows|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.
 
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.
Line 44: Line 44:
  
 
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.
 
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:
 +
 +
<code>sudo port selfupdate && sudo port upgrade outdated</code>
 +
 +
=== Uninstalling ===
 +
To uninstall both Wine and MacPorts, simply run the following command in the Terminal:
 +
 +
<code>sudo rm -rf /opt ~/.wine /Applications/MacPorts</code>
 +
 +
To uninstall just Wine, simply run the following command in the Termianl/shell:
 +
 +
<code>sudo port uninstall wine</code>
  
 
=== Wineskin ===
 
=== Wineskin ===
Line 65: Line 79:
  
 
The program will soon appear, ready to use.
 
The program will soon appear, ready to use.
 
== Updating ==
 
To keep Wine up-to-date, it is recommended to run the following command every few months or so via the Terminal/shell:
 
 
<code>sudo port selfupdate && sudo port upgrade outdated</code>
 
 
== Uninstalling ==
 
On Mac, to uninstall both Wine and MacPorts, simply run the following command in the Terminal:
 
 
<code>sudo rm -rf /opt ~/.wine /Applications/MacPorts</code>
 
 
On Linux, or on Mac to uninstall just Wine, simply run the following command in the Termianl/shell:
 
 
<code>sudo port uninstall wine</code>
 
  
 
== Common Issues ==
 
== Common Issues ==

Revision as of 19:52, 11 November 2012

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 and are using OS X, then try Wineskin.

Linux

Installation

Most distributions of Linux come with Wine pre-installed. However, if it is not, or if you would like the latest version, then it can easily be downloaded from http://www.winehq.org/download/.

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!

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.

General Information

The Wine Website

The Wine Wiki

The Wine Wikipedia Page