G LU G | National Institute of Technology Hamirpur

What is Wine?

Wine is an Open Source implementation of the Windows API on top of X and Unix. Think of it as a compatibility layer for running Windows programs.

Wine does not require Microsoft Windows, as it is a completely free alternative implementation of the Windows API consisting of 100% non-Microsoft code, however Wine can optionally use native Windows DLLs if they are available.

»»Visit Wine HQ

Announcements

We are in the process of enriching our bulletin board and tutorial sections. So anyone interested in writing a tutorial, a review, or sharing interesting links, can just type them down and mail copies to Debarshi ( [email protected] ) and me ( [email protected] ), and we will take care of the rest. Make sure you include the text (plain text only), relevant screenshots and other stuff as seperate attachments.

Posted by Arjun Shankar at 14:08 hr 01/04/2006.

Go! Go! Go!

Okey! This is the one reason why many of us resist switching over to Linux. Games! Especially Counter Strike, which is very popular in the campus.

First of all, a little talk about wine...
Wine (whose full form is "Wine Is Not an Emulator", a recursive acronym) is a program that provides Windows APIs, so that a windows executable can run through wine, independent of windows. This means you can install most common windows programs on your linux installation, and expect them to work as fast as they used to work on windows. In fact, if the program uses APIs whose wine implementation is faster than the native windows code, it will actually run faster on wine. I have actually _seen_ my notebook run Counter Strike faster and better with wine than when I was dual booting with windows (primarily because I needed windows for all the gaming).

So, for this tutorial, we will install Counter Strike.

Counter Strike

Lets break this down into three steps (the tird one is our ultimate aim right? ;)):
1. Installing and preparing wine
2. Installing and preparing Counter Strike

Step 1. Installing and preparing wine

Fedora Core 5 users can download and install the rpm from our ftp server here:



Code for installing:
----------------------------------------------------------------------------------------------------
su - (This is to become root)
cd directory-where-you-downloaded-the-wine-rpm
rpm -ivh wine-0.9.12-1.fc5.i386.rpm (This is to install the wine rpm)
exit (To give up root privilages)
----------------------------------------------------------------------------------------------------

Ubuntu users can download and install the deb from our ftp server here:
Code for installing:
----------------------------------------------------------------------------------------------------
cd directory-where-you-downloaded-the-wine-rpm
sudo dpkg -i wine-0.9.11-winehq-i386.deb (This is to install the wine rpm)
----------------------------------------------------------------------------------------------------
I hope you know that you can use sudo only if you are a sudoer. And the password required will be _your_ password, not the _root_ password.

If you are more adventurous, you can install from source. Get the latest wine source from here: http://winehq.org/site/download or from our own ftp server here: . I won't give details on how to do this.

Now, wine needs to be set up so as to be able to run Counter Strike properly.
In a terminal (as a normal user, not as root!) type these:
----------------------------------------------------------------------------------------------------
wine (This creates the /home/you-user-id/.wine directory)
winecfg (This opens up the wine configuration app)
----------------------------------------------------------------------------------------------------
Now select the 'Drives' Tab and hit autodetect. As you will see, your partitions will be assigned different drive letters, windows style, for use in windows programs that you install, including CS.
Close the app.
Now to install the activex control and fonts that wine requires...
Get the activex control from transgaming: mozcontrol.tgz OR from our server here: . Get the fonts from here: . You must have a legal copy of windows to use these fonts ;). Open up a terminal and type this as a normal user:
----------------------------------------------------------------------------------------------------
cd directory-where-you-downloaded-mozcontrol
tar -zxvf mozcontrol.tgz -C ~/.wine/drive_c/Program\ Files/
----------------------------------------------------------------------------------------------------
Now the activex control will be extracted to ~/.wine/drive_c/Program\ Files/mozcontrol. Next do this:
----------------------------------------------------------------------------------------------------
cd ~/.wine/drive_c/Program\ Files/mozcontrol
wine regsvr32 mozctlx.dll (This will load the activex control dll)
cd directory-where-you-downloaded-fonts
tar -xvf fonts.tar -C ~/.wine/drive_c/windows/fonts/ (This will install fonts)
----------------------------------------------------------------------------------------------------
You are all set to install Counter Strike.

Step 2. Installing and preparing Counter Strike

----------------------------------------------------------------------------------------------------
cd directory-where-you-got-cs-install-executable
wine cs-install-executable-file-name (install.exe or whatever)
----------------------------------------------------------------------------------------------------
Select a drive and diretory where you have write permissions, for installing it. In fact, create it before you install CS.
Once done, open up a terminal and cd into the directory where you installed CS (by default, this was ~/.wine/drive_c/Program\ Files/Valve with my installer).Once there, type this:
----------------------------------------------------------------------------------------------------
wine hl.exe -game cstrike -heapsize 128000

----------------------------------------------------------------------------------------------------

Counter Strike running on my notebook @ 1024x768x16.

If you want to play another mod, like condition zero, just change the game flag. eg. "-game czero" instead of "-game cstrike". The "-heapsize 128000" parameter allots 128MB of RAM to the game initially itself, this makes it respond quicker. You can allot more or less, depending on how much RAM you got. Default is 64MB. If you want to improve performance even more, try this command instead:
----------------------------------------------------------------------------------------------------
nice -n -20 wine hl.exe -game cstrike -heapsize 128000
----------------------------------------------------------------------------------------------------
Enjoy!

Oh! And I learnt all this neat stuff from the linuxgamers HowTo section here . Thanks Guys!

Posted by Arjun Shankar at 15:00 hr 26/04/2006.