249 lines
13 KiB
HTML
249 lines
13 KiB
HTML
<!--startcut ==============================================-->
|
|
<!-- *** BEGIN HTML header *** -->
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
|
|
<HTML><HEAD>
|
|
<title>Wine: Raising a toast to your Windows Apps on Linux LG #80</title>
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#0000AF"
|
|
ALINK="#FF0000">
|
|
<!-- *** END HTML header *** -->
|
|
|
|
<CENTER>
|
|
<A HREF="http://www.linuxgazette.com/">
|
|
<IMG ALT="LINUX GAZETTE" SRC="../gx/lglogo.png"
|
|
WIDTH="600" HEIGHT="124" border="0"></A>
|
|
<BR>
|
|
|
|
<!-- *** BEGIN navbar *** -->
|
|
<!-- *** END navbar *** -->
|
|
<P>
|
|
</CENTER>
|
|
|
|
<!--endcut ============================================================-->
|
|
|
|
<H4 ALIGN="center">
|
|
"Linux Gazette...<I>making Linux just a little more fun!</I>"
|
|
</H4>
|
|
|
|
<P> <HR> <P>
|
|
<!--===================================================================-->
|
|
|
|
<center>
|
|
<H1><font color="maroon">Wine: Raising a toast to your Windows Apps on Linux</font></H1>
|
|
<H4>By <a href="mailto:tech@gauravtaneja.com">Gaurav Taneja</a></H4>
|
|
</center>
|
|
<P> <HR> <P>
|
|
|
|
<!-- END header -->
|
|
|
|
|
|
|
|
|
|
<P STYLE="font-weight: medium"><FONT SIZE=3>When I first started
|
|
working on Linux some years back I did rely on a standby Windows OS
|
|
installed in another partition in case something would fail. But soon
|
|
I realized that this Open Source OS had everything to offer without
|
|
my spending a penny. However, there are still times when I feel the
|
|
need to fire up some application that's written exclusively for Windows. What
|
|
do you do in such a situation? The answer is Wine.</FONT></P>
|
|
<P><FONT SIZE=4><B>Wine has nothing to do with liquor !</B></FONT></P>
|
|
<P><SPAN STYLE="font-weight: medium"><FONT SIZE=3>There are products
|
|
like VMWare & Win4Lin that will let you run another OS (usually
|
|
Windows) on a running</FONT></SPAN> Linux machine so that you can run
|
|
your Windows programs. You could also go in for a more traditional
|
|
approach of having another partition with Windows installed on
|
|
it.However, these alternatives are more of an overhead on your system
|
|
than a solution.</P>
|
|
<P>Wine stands apart from all these options, Wine, which stands for
|
|
“WINE Is Not an Emulator”, doesn't require you to buy a
|
|
Windows licensed copy. It it accomplishes this by rewriting the
|
|
complete Win32 APIs which differs from the Microsoft Code.</P>
|
|
<P><FONT SIZE=4><B>Let's Raise a Toast</B></FONT></P>
|
|
<P><SPAN STYLE="font-weight: medium"><FONT SIZE=3>If you would like
|
|
to try WINE, you can get the latest sources from the WINE
|
|
headquarters at <A HREF="http://www.winehq.com/">http://www.winehq.com</A>.
|
|
Building from source may not be necessary. The site has links to
|
|
daily builds in many different formats. Should you wish to obtain the
|
|
source and build for yourself, you’ll find that it is pretty
|
|
straightforward.</FONT></SPAN></P>
|
|
<P STYLE="font-weight: medium"><FONT SIZE=3>The following steps can
|
|
be taken to accomplish your task:</FONT></P>
|
|
<PRE><I>gunzip Wine-20020411.tar.gz</I>
|
|
<I>tar -xvf Wine-20020411.tar</I>
|
|
<I>cd wine-20020411</I>
|
|
<I>./configure</I>
|
|
<I>make depend</I>
|
|
<I>make</I>
|
|
<I>make install</I>
|
|
</PRE>
|
|
|
|
If you are interested in the bleeding-edge version of Wine and as a matter of fact any major software you should
|
|
follow the path of CVS.The latest source in the CVS tree might prove to be more efficient in terms of raw performance.
|
|
The following procedure can be followed to grab the latest source:
|
|
<PRE>
|
|
<I>export CVSROOT=:pserver:cvs@cvs.winehq.com:/home/wine</I>
|
|
<I>cvnpres login</I>
|
|
</PRE>
|
|
|
|
When asked for password, provide 'cvs':
|
|
|
|
<pre>
|
|
<I>cvs -z 3 checkout wine</I></PRE><P>
|
|
You will see a steady stream of files coming into a directory called
|
|
“<I>wine</I>” relative to your current directory. After the
|
|
whole process is complete you can follow the same procedure of
|
|
compilation as above.</P>
|
|
<P><FONT SIZE=4><B>Wine Configuration</B></FONT></P>
|
|
<P>We will need a configuration file called “config” in the
|
|
“<I>~/.wine/” directory. You</I> can copy the a sample of
|
|
the same from the source directory:</P>
|
|
<PRE STYLE="margin-bottom: 0.2in"><I>cp documentation/samples/config ~/.wine/config</I></PRE><P>
|
|
The “config” file might appear daunting at a first glance
|
|
but you better stick to the defaults and change only the critical
|
|
parts that relate to your system.You will encounter a section
|
|
something like this:</P>
|
|
<P><I>[Drive A]<BR>"Path" = "/mnt/fd0"<BR>"Type"
|
|
= "floppy"<BR>"Label" = "Floppy"<BR>"Serial"
|
|
= "87654321"<BR>"Device" = "/dev/fd0"</I></P>
|
|
<P><I>[Drive C]<BR>"Path" = "/c"<BR>"Type"
|
|
= "hd"<BR>"Label" = "MS-DOS"<BR>"Filesystem"
|
|
= "win95"</I></P>
|
|
<P><I>[Drive D]<BR>"Path" = "/cdrom"<BR>"Type"
|
|
= "cdrom"<BR>"Label" = "CD-Rom"<BR>"Filesystem"
|
|
= "win95"<BR>; make sure that device is correct and has
|
|
proper permissions !<BR>"Device" = "/dev/cdrom"</I></P>
|
|
<P>Wine actually tries to emulate a DOS-like drive and folder
|
|
structure so the section which starts with “<I>[Drive C]”</I>
|
|
indicates the mapping of a hypothetical drive C: to your linux
|
|
directory which in our case is “/c<I>”</I>.</P>
|
|
<P>Next, some system folders like “windows<I>”</I> and
|
|
“system<I>”</I> are also mapped like this in the “[wine]<I>”</I>
|
|
section:</P>
|
|
<P><I>"Windows" = "c:\\windows"<BR>"System"
|
|
= "c:\\windows\\system"<BR>"Temp" = "e:\\"<BR>"Path"
|
|
= "c:\\windows;c:\\windows\\system;e:\\;e:\\test;f:\\"<BR>"Profile"
|
|
= "c:\\windows\\Profiles\\Administrator"<BR>"GraphicsDriver"
|
|
= "x11drv"<BR>; Wine doesn't pass directory symlinks to
|
|
Windows programs by default.<BR>; Enabling this may crash some
|
|
programs that do recursive lookups of a whole<BR>; subdir tree in
|
|
case of a symlink pointing back to itself.<BR>;"ShowDirSymlinks"
|
|
= "1"<BR>"ShellLinker" = "wineshelllink"</I></P>
|
|
<P><I><BR></I>We will have to create some the basic Windows directory
|
|
structure (“windows<I>”</I> , “system<I>”</I>
|
|
directories as mentioned in the “<I>[wine]”</I> section in
|
|
the “config<I>”</I> file:
|
|
</P>
|
|
<PRE><I>cd /c</I>
|
|
<I>mkdir -p windows/system</I>
|
|
<I>mkdir -p windows/Start\ Menu/Programs</I></PRE><P STYLE="font-weight: medium">
|
|
<FONT FACE="Times New Roman, serif"><FONT SIZE=3>The “<I>[DllOverrides]”</I>
|
|
section of the config file handles the DLLs that are supplied with
|
|
Wine to be used in place of their Windows counterpart and some native
|
|
Windows DLLs that you might want to use: </FONT></FONT>
|
|
</P>
|
|
<P STYLE="font-weight: medium"><FONT SIZE=3><I>; Be careful here,
|
|
wrong DllOverrides settings have the potential<BR>; to pretty much
|
|
kill your setup.<BR>[DllOverrides]<BR>"commdlg" = "builtin,
|
|
native"<BR>"comdlg32" = "builtin, native"<BR>"ver"
|
|
= "builtin, native"<BR>"version" = "builtin,
|
|
native"<BR>"shell" = "builtin, native"<BR>"shell32"
|
|
= "builtin, native"<BR>"shfolder" = "builtin,
|
|
native"<BR>"shlwapi" = "builtin,
|
|
native"<BR>"shdocvw" = "builtin,
|
|
native"<BR>"lzexpand" = "builtin, native"<BR>"lz32"
|
|
= "builtin, native"<BR>"comctl32" = "builtin,
|
|
native"<BR>"commctrl" = "builtin,
|
|
native"<BR>"advapi32" = "builtin,
|
|
native"<BR>"crtdll" = "builtin, native"<BR>"mpr"
|
|
= "builtin, native"........</I></FONT></P>
|
|
<P>Various Ports and devices also can be configured in the
|
|
<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN><I>[serialports]<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></SPAN></I>
|
|
section:</P>
|
|
<PRE><I>Com1=/dev/ttyS0</I>
|
|
<I>Com2=/dev/ttyS1</I>
|
|
<I>Com3=/dev/modem,38400</I>
|
|
<I>Com4=/dev/modem</I></PRE><P STYLE="margin-bottom: 0in; font-style: normal">
|
|
The general appearance of the windows can be changed in the
|
|
<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN><I>[Tweak.Layout]<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">”
|
|
</FONT></FONT></SPAN></I>section.</P>
|
|
<P STYLE="margin-bottom: 0in"><BR>
|
|
</P>
|
|
<P STYLE="margin-bottom: 0in"><I>;; supported styles are
|
|
'Win31'(default), 'Win95', 'Win98'<BR>;; this has *nothing* to do
|
|
with the windows version Wine returns:<BR>;; use cmdline option
|
|
--winver if you want that.<BR>"WineLook" = "Win98"</I></P>
|
|
<P STYLE="margin-bottom: 0in"><BR>
|
|
</P>
|
|
<PRE STYLE="margin-bottom: 0.2in; font-style: normal"><FONT FACE="Times New Roman, serif"><FONT SIZE=4><B>Remember the Windows Registry ? </B></FONT></FONT></PRE><P>
|
|
Next, we need to install a default registry which will exactly match
|
|
the way registry exists on a Windows Box.But before you do this we
|
|
need to make minor changes to <SPAN STYLE="font-weight: medium"><SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN></SPAN><I>/etc/ld.so.conf<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">”
|
|
</FONT></FONT></SPAN></I>. We'll add a line <SPAN STYLE="font-weight: medium"><SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN></SPAN><I>/usr/local/lib/wine<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></SPAN></I>,
|
|
which relates to all the libraries used by the software to mimic a
|
|
Windows atmosphere.</P>
|
|
<P>Don't forget to run <SPAN STYLE="font-weight: medium"><SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN></SPAN><I>/sbin/ldconfig<SPAN STYLE="font-weight: medium"><FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></SPAN></I>
|
|
after this step.</P>
|
|
<P>Next, we will use <B>regapi</B> to install a default registry.
|
|
From the Wine source directory issue the following command:
|
|
</P>
|
|
<PRE STYLE="margin-bottom: 0.2in"><I>programs/regapi/regapi setValue < winedefault.reg</I></PRE><P>
|
|
<FONT SIZE=4><B>Let's Fire it up!!</B></FONT></P>
|
|
<P STYLE="font-weight: medium">Without waiting any further let's try
|
|
our hands on our Wine installation to run a simple Windows App.We
|
|
will try to run the standard Calculator which comes with Windows
|
|
(<SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN>calc.exe<I><FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></I>).</P>
|
|
<P STYLE="font-weight: medium">You can mount your windows partition
|
|
or copy the file <SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN><I>calc.exe<FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></I>
|
|
with a floppy to your system in the folder <SPAN STYLE="font-style: normal"><FONT SIZE=3><FONT FACE="Times New Roman, serif">“</FONT></FONT></SPAN>/c/windows<I><FONT SIZE=3><FONT FACE="Times New Roman, serif">”</FONT></FONT></I>
|
|
and use any one of the ways to start it up:</P>
|
|
<P STYLE="font-weight: medium"><I>cd /c/windows; wine calc.exe<BR>wine
|
|
/c/windows/calc.exe<BR>wine "c:\windows\calc.exe"</I></P>
|
|
<P STYLE="font-weight: medium">This is the way it appears on my Linux
|
|
box. Pretty amazing isn't it!
|
|
</P>
|
|
<P><BR><BR>
|
|
</P>
|
|
<P><IMG SRC="misc/taneja/calc.png" NAME="Graphic1" ALT="Calculator Screenshot" ALIGN=LEFT WIDTH=702 HEIGHT=426 BORDER=0><BR CLEAR=LEFT><BR><BR>
|
|
</P>
|
|
<P><BR><BR>
|
|
</P>
|
|
<P><B>Bye Bye for now!</B></P>
|
|
<P STYLE="font-weight: medium">Wine is pretty indispensable when you
|
|
have to run Windows executables on your Linux box but one thing to
|
|
note here is that not all of your Applications will work on Wine, you
|
|
will have to figure out ways and tweaks to make your favorite App.
|
|
work fine. But for many cases Wine proves to be of a great help.</P>
|
|
|
|
|
|
|
|
|
|
<!-- *** BEGIN bio *** -->
|
|
<SPACER TYPE="vertical" SIZE="30">
|
|
<P>
|
|
<H4><IMG ALIGN=BOTTOM ALT="" SRC="../gx/note.gif">Gaurav Taneja</H4>
|
|
<EM>I work as a Technical Consultant in New Delhi,India in Linux/Java/XML/C++.
|
|
I'm actively involved in open-source projects, with some hosted on
|
|
SourceForge. My favorite leisure activities include long drives, tennis,
|
|
watching movies and partying. I also run my own software consulting company
|
|
named <A HREF="http://www.broadstrike.com">BroadStrike Technologies</A>.</EM>
|
|
|
|
<!-- *** END bio *** -->
|
|
|
|
<!-- *** BEGIN copyright *** -->
|
|
<P> <hr> <!-- P -->
|
|
<H5 ALIGN=center>
|
|
|
|
Copyright © 2002, Gaurav Taneja.<BR>
|
|
Copying license <A HREF="../copying.html">http://www.linuxgazette.com/copying.html</A><BR>
|
|
Published in Issue 80 of <i>Linux Gazette</i>, July 2002</H5>
|
|
<!-- *** END copyright *** -->
|
|
|
|
<!--startcut ==========================================================-->
|
|
<HR><P>
|
|
<CENTER>
|
|
<!-- *** BEGIN navbar *** -->
|
|
<!-- *** END navbar *** -->
|
|
</CENTER>
|
|
</BODY></HTML>
|
|
<!--endcut ============================================================-->
|