Escolar Documentos
Profissional Documentos
Cultura Documentos
48
What is Wine?
Wine is awesome. No, I'm not talking about the kind you drink, I mean the kind that lets
you run Windows apps without the Windows operating system. It's kind of Zen, when you
think about it. Oh, and did I mention it's completely free, legal, and open source?
Nowadays, Windows and Mac play nicely together. You can install Windows and Mac side
by side and switch between them using Boot Camp, but that requires a reboot every time,
and you can only use one operating system at a time. You can also use a tool like Parallels
Desktop or VMware Fusion to virtualize Windows and run it together with Mac, but
virtualization is slow and it takes up a lot of memory. (Your physical computer creates an
imaginary "virtual" computer within itself, and runs Windows on that. That takes a lot of
resources!) On top of that, all of these solutions require you to own a legal copy of
Windows, which isn't cheap!
Wine is different. When any program runs, it requests resources like memory and disk
space from the operating system. All that Wine does is make sure that those requests get
answered so that the program can run correctly. As far as the program knows, everything
is going smoothly because it has everything it needs. It never even realizes that it's not
running on Windows! It's simpler than emulating a whole new computer, so it's faster.
Since it's just translating requests, you don't need a copy of the actual Windows operating
http://davidbaumgold.com/tutorials/wine-mac/ Page 1 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
system. Plus, Wine is open source, which means people are continually improving it and
adding new features. And you can't beat the price!
Requirements
To install Wine on your Mac, you will need the following:
An Intel Mac
Unfortunately, you can't install Wine on an older PowerPC Mac: it will only work with
an Intel Mac. All new Macs use Intel processors. To see if your Mac has an Intel
processor, go to the Apple logo on the far left of the toolbar, select About This Mac,
and look at the Processor description. If it contains the word "Intel," you're good to go!
Access to an Admin account, with password
You can't install software unless you're an Admin. You will need to be logged in to this
Admin account during the installation. If there is only one account on your computer, it
is an Admin account. Also, the account must have a password set: if the account has no
password, the sudo utility will fail. To set or change your password, go to the Accounts
section in System Preferences.
Apple Xcode
You can install Xcode from your Mac OS X installation DVD, or you can download it
from the Apple website. It's free, but to download it you'll need to get a free Apple
Developer account first. If you're running Snow Leopard (10.6), you'll need Xcode 3.2
or higher. If you're running Leopard (10.5), you'll need Xcode 3.1. If you're running
Tiger (10.4), you'll need Xcode 2.5.
X11
X11 is installed by default on Snow Leopard and Leopard. If you are running Tiger, you
can install X11 from your Tiger installation DVD using the "Optional Installs.mpkg"
file.
An internet connection
If you're reading this tutorial, you should be set.
About an hour
Don't worry, you won't need to be actually sitting at your computer for most of that
http://davidbaumgold.com/tutorials/wine-mac/ Page 2 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
time.
The Terminal will ask for your password: this is the password to the Admin account on
your computer. As a security measure, the Terminal does not display anything as you
type, not even asterisks ( * ). Type your password anyway, and press enter. If you ran the
command correctly, the Terminal should respond with:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export MANPATH=/opt/local/man:$MANPATH
If you didn't get that response, it might be because the Admin account doesn't have a
password set. Setting a password is required.
2. Next, run this command (without the $ ):
l/etc/macports/variants.conf; else echo "not 64bit capable"; fi
If you have a newer computer running Snow Leopard, the Terminal will respond with
"+universal". If you have an older computer, the Terminal will respond with "not 64bit
capable". Either way is fine, but MacPorts needs to know one way or the other, and that
command should do the trick.
3. Close and reopen the Terminal window.
http://davidbaumgold.com/tutorials/wine-mac/ Page 3 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
You may be asked for your Admin account password again. The Terminal will start
displaying lots of information. This is absolutely normal — MacPorts is just keeping you
updated on what it's doing. This flow of information will be your guide to let you know
whether or not the computer is still working. It will take a while for the install to finish: at
least half an hour. As long as the Terminal keeps on giving you more information about
what it's doing, don't interrupt it. Feel free to leave and do something else while the
computer is installing Wine. When the Terminal stops giving you more information and is
ready for another command, Wine is installed and ready to go!
Note: If you get an error message at this step that reads error: C compiler cannot
create executables or Failed to locate 'make' in path , it means you forgot
to install Xcode. See the requirements.
Once you are in the correct directory, run the installer through Wine by running the
following command in the Terminal:
$ wine $INSTALLER.exe
Where $INSTALLER is the name of the installer file. For example, if the installer file is
named setup.exe , you would run:
$ wine setup.exe
X11 will open (if it isn't already), and soon you will see a regular graphical Windows
installer. Click through it, and you're done!
$ cd ~/.wine/drive_c/Program\ Files/
Run ls to see what programs you have installed. Pick a program, and enter its directory
using cd . (If the folder has a space in it, you must type a \ before the space. For example,
Program\ Files . If you're having problems, try using tab autocomplete.) There should
http://davidbaumgold.com/tutorials/wine-mac/ Page 4 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
be a file that ends in .exe : this is the program file. Type this into Terminal:
$ wine $PROGRAM.exe
Where $PROGRAM is the name of the .exe file. X11 will open (if it isn't already), and the
program will pop up, ready to use! It will probably open fullscreen: to reduce it in size, go
open the Window menu from the Mac OS X menu bar, and select Zoom Window. You
can then resize the program normally. Enjoy using Windows on your Mac, freely and
legally!
Open up your Script Editor. You should see a window with a large area you can type in
near the top: this is where you write your AppleScript. In that area, type the following text:
You'll need to replace $PATH_TO_PROGRAM with the path from the Program Files
directory to your program executable. You can see that you're simply telling the
AppleScript to run a line of code in the Terminal: the same line of code that you could run
to start your Windows program.
http://davidbaumgold.com/tutorials/wine-mac/ Page 5 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
Next, press the Compile button at the top of the window. The text should become colored
to indicate that Script Editor understands what you wrote. You can also try pressing the
Run button to run your script: it should open the Windows program successfully.
Lastly, save your script. You can give it whatever name you'd like, but be sure to select File
Format: Application in the save options, and leave Startup Screen unchecked.
Open up the Finder, go to where you saved your script, and drag that file to your Dock. It
should stay there, just like a real application -- because it is a real application! However, all
it does is run that launcher command for you, so you can move the application around,
rename it, or even delete it, and it won't affect the Windows program that you're running.
Once again, you will need to enter your Admin account password. With this command,
MacPorts will first update itself, if any updates are available. It will then find all the
outdated software it knows about (including Wine) and upgrade them all to the latest
version. Checking for updates isn't strictly necessary, as Wine runs quite well currently.
However, it's a good idea to run this command every few months or so.
And MacPorts will helpfully remove Wine from your computer. However, in order to
install Wine, MacPorts also had to install many other small programs that Wine relies upon
to work correctly. (That's why the install process takes so long!) If you want to remove
these as well, it's simplest to just delete your entire MacPorts installation with the following
command:
$ sudo rm -rf /opt ~/.wine
That command should remove everything that you installed in this tutorial, including
MacPorts, Wine, and all the other programs MacPorts installed to get Wine to work
correctly.
http://davidbaumgold.com/tutorials/wine-mac/ Page 6 of 7
Installing Wine on Mac OS X 2010-11-07 18.48
So why would you ever use the first of those two commands, rather than the second? Well,
MacPorts can install a lot more than just Wine. There are a whole bunch of nifty programs
you can easily install using MacPorts, such as GraphViz (a very swanky graphing tool),
Battle for Wesnoth (a turn-based strategy game), and GIMP (an image editor, like Adobe
Photoshop). And just like Wine, every program available on MacPorts is free and open
source. Even if you decide Wine isn't for you, MacPorts might have something else you
might like. Take a look!
http://davidbaumgold.com/tutorials/wine-mac/ Page 7 of 7