Saturday February 11, 2012 7:06 AM AEST

Installing WINE

By Leigh Cook
11:17 May 9, 2008
Tags: Installing | WINE | howto | tutorial
« 
Installing WINE
Patching and Call of Duty 4
The other benefit to building from source is that you can patch the code to fix specific issues. Some games fall just short of running under Wine because a specific feature is missing, and in some cases, developers have put together quick fixes that address the issue just well enough to get a game going. Since they don’t truly solve the problem they’re not something that can be integrated into the Wine source code, but when building from source, you can add them in yourself.

Call of Duty 4 is a great example of a game that just needs a small patch to get running. It’s amazing that it works at all under Wine – unlike Team Fortress 2, which is based on a three-year-old engine that scales down nicely, COD4 runs on an all-new DirectX 9-only engine, so it pushes the graphics support in Wine to its limits. The frame rate isn’t fantastic, and you do have to disable a few effects, but the single-player campaign at least is more than playable.

The patch (which is really for 3DMark05, though it works with COD4 too) is available here – save its contents to a file called ‘wined3d-alphablend-hack.patch’. Install Wine from source as above, but after running the ‘make depend’ step, add the patch, and then continue with the remaining steps:

patch -p1 <~/wined3d-alphablend-hack.patch


If you had already installed from source, there’s no need to build the whole thing again – simply apply the patch as above, and re-run the steps after the “make depend” step. The build system is smart enough to only rebuild the source code files that the patch changed, so the rebuild will only take a few seconds.

To install Call of Duty 4 itself, you should be able to just run the installer from the DVD, though I didn’t have much luck with this. In the end, I had to install it under Windows and then copy the installed folder across to Wine’s virtual C: drive, and then install a no-CD patch to get around issues with the copy protection routines. You’ll also need to install ‘d3dx9_34.dll” – just search for it online and download it in to your same folder as COD4’s ‘iw3sp.exe’ executable.

If you installed the patch correctly, the game should start without a problem – otherwise, the game will complain about missing alpha blend features. Once you have it running, you need to disable the ‘Soften Smoke Edges’ and ‘Depth of Field’ options to prevent graphical corruption issues, but beyond that, you can adjust the other settings as required to find a good balance between shinyness and frame rate.

Message in a bottle
With so many settings to tweak, both in ‘winecfg’ and in the Wine registry, it can be a major hassle to reconfigure Wine when you switch from one game to another. The alternative is to install each game in to its own virtual Windows drive, with separate registries, so that you can tweak each of them independently. There’s a commercial version of Wine called CodeWeavers that does just this, calling the individual systems ‘bottles’, but you can do exactly the same thing with standard Wine:

1) Create a new folder to hold your Wine data and settings. As an example, we’ll make one for Call of Duty 4:

mkdir -p ~/wine/cod4


2) Run the ‘wineprefixcreate’ tool on this folder:

WINEPREFIX=~/wine/cod4 wineprefixcreate


If you check inside the folder, you’ll now see a ‘drive_c’ folder and registry files, just like in your ‘~/.wine’ folder. To run an application inside this system, set the WINEPREFIX environment variable when running ‘wine’, as we did with the ‘winprefixcreate’ command:

WINEPREFIX=~/wine/cod4 wine setup.exe


You’ll have to specify the WINEPREFIX each time you run an application outside of your normal ‘~/.wine’ folder. However, Wine is smart enough to automatically add the proper WINEPREFIX variable to any desktop or menu shortcuts created for installed applications, so if you launch everything through the desktop, it should Just Work (TM).

 
« 
 
This article appeared in the April, 2008 issue of Atomic.

Behind the scenes with Mass Effect 3! GTX 560 VGA round-up! Essential Skyrim tweaks to improve your game! Plus reviews, news, hardware, more games, and easy to following modding guides for PC builders. ON SALE NOW!
 
Latest Competitions
 
Atomic Magazine

Issue: 133 | February, 2012

Atomic is a magazine aimed squarely at computer enthusiasts, gamers, and serious PC upgraders.

Every month we bring you the latest reviews of new technology and PC components, in depth features on everything from overclocking to console hacking, and gaming previews and interviews.
 
Latest Comments
 
Latest User Reviews
Battlefield 3 is the new benchmark online FPS
90%
A very fun and realistic multiplayer ride.
 
Antec Kuhler 920 - liquid cool
90%
Antec Kuhler 920 silent but effientive out of the box no maintence water cooling kit
 
Antec's Lanboy Air - our new favourite case
90%
Antec Lan boy Air in red a very cool design
 
Antec's Lanboy Air - our new favourite case
90%
This product overall is awesome.
 
MSI's GT780 laptop as fast as it gets
90%
Nice laptop
 
 
Close Get the February, 2012 issue of Atomic mailed to you for $8.95, including postage.

Buy nowDigital Version