If you prefer to use Ubuntu Linux over Windows but you still have some Windows programs that have no equivalent in Linux, there is a way to run some Windows programs in your Linux environment.
Wine is a compatibility layer that allows you, in theory, to run some applications written for Windows on a Unix-like system. However, some applications may require tweaking to get them to run correctly. Wine is easy to install and runs fine on Ubuntu 10.04 Lucid Lynx.
To find out which programs run in Wine, refer to the Wine Application Database, found at http://appdb.winehq.org/. There are different levels of ratings indicating how well each program in the database behaves in Wine.
For this example, we are going to install 7-Zip in Wine. 7-Zip is a very good free compression utility and file manager for Windows. It has a Platinum rating, which means it installs and runs flawlessly on a standard, default Wine installation, with no tweaking required.
To install Wine, open a terminal window by selecting Accessories | Terminal from the Applications menu.
Enter the following command:
$ sudo apt-get install wine
Enter your password to authenticate, and Wine starts to find what it needs. A message telling you the size of the installation displays and you are asked if you want to continue. If you have enough disk space and want to continue the installation, type a ‘Y’ (case does not matter) and press Enter. It might take a while to install depending upon your connection speed.
The progress of the installation displays in the terminal window.
When the installation is finished, you are returned to a prompt. Type ‘exit’ and press Enter to close the terminal window.
There is now a new Wine category added to your Applications menu on your desktop. The Wine category has four subcategories:
- Programs lets you browse the Windows programs installed in Wine programs on your system.
- Browse C: Drive lets you browse the C: drive structure Wine emulates for Windows programs.
- Configure Wine lets you tweak settings for Wine itself and for the Windows programs installed in Wine.
- Uninstall Wine Software lets you remove Windows programs installed in Wine. An Add/Remove Programs dialog box displays that also allows you to install Windows programs.
We downloaded the executable, installation file for 7-Zip into a 7zip directory in the Downloads directory. Before installing a program in Wine, you must first make sure the installation file has executable permission. To do this, open the File Browser using the Places menu and navigate to the directory into which you downloaded 7-Zip, if necessary.
Right-click on the 7-Zip executable file and select Properties from the pop-up menu.
Click the Permissions tab on the Properties dialog box, and make sure the Allow executing file as program check box is checked.
Click the Close button.
There are two different methods for starting an installation of a Windows program in Wine. The first method is to right-click on the executable installation file and select Open with Wine Windows Program Loader from the pop-up menu.
The second method is to open the Wine Uninstaller by selecting Wine | Uninstall Wine Software from the Applications menu. This may seem misleading, but the option also allows you to install software.
NOTE: The first time you perform any action in Wine, the following dialog box displays.
If you opened the Wine Uninstaller, the Add/Remove Programs dialog box displays. Click the Install button.
On the secondary Add/Remove Programs dialog box that displays, navigate to the directory containing the 7-Zip executable file, select it and click Open.
Both methods of starting an installation of a Windows program results in the first screen of the Setup Wizard displaying. Follow the instructions in the installation program, the same way you would in Windows. For our example of installing 7-Zip, accept the default installation location on the first screen and click Install.
When the 7-Zip installation is finished, the dialog box informs you. Click the Finish button to close the setup wizard.
If you installed 7-Zip using the Add/Remove Programs dialog box, you are returned to the dialog box. Click OK to close it.
NOTE: The list of software on the Add/Remove Programs dialog box that can be automatically removed is not automatically updated even though you just installed a program. To populate the list of installed software, you must close the dialog and reopen it.
Programs installed in Wine generally reside in the ~/.wine/drive_c/Program Files/ directory, unless you chose a different location during the installation. You will notice that 7-Zip was installed into a 7-Zip directory in the Program Files directory, just like it would be in Windows.
One feature that is not available in 7-Zip running in Wine, is the integration with the File Browser. You cannot zip files by right-clicking on them in the File Browser. To zip one or more files, select 7-Zip File Manager under Wine | Programs | 7-Zip on the Applications menu.
In the 7-Zip File Manager, navigate to the file(s) you want to zip, select them, and select 7-Zip | Add to “filename.zip” from the pop-up menu. A name for the zip file is suggested depending on the directory you are currently in.
The zip file is created in the current directory.
To close the 7-Zip File Manager, select Exit from the File menu.
Wine provides an uninstaller for uninstalling Windows programs installed using a .exe file.
NOTE: The Wine uninstaller does not work with programs installed using an .msi file.
To uninstall 7-Zip, select Wine | Uninstall Wine Software from the Applications menu.
You can also uninstall a program in Wine by navigating to the program’s directory in the ~/.wine/drive_c/Program Files/ directory (~ stands for the Home directory) and right-clicking on the uninstall executable file, if there is one, and selecting Open with Wine Windows Program Loader from the pop-up menu. In the case of 7-Zip, there is a file called Uninstall.exe.
Using either method for starting to uninstall a program in Wine, opens the Add/Remove Programs dialog box. 7-Zip displays in the list of software that can be automatically removed. Select the 7-Zip file and click the Modify/Remove button.
The 7-Zip Uninstall dialog box displays. Click the Uninstall button.
You can tweak settings for both individual programs within Wine and for Wine itself. To change settings, select Wine | Configure Wine from the Applications menu.
The Wine configuration dialog box displays. Click the different tabs to change the various settings available.
If you want to browse Wine’s C: drive the same way you would in Windows, select Wine | Browse C: Drive from the Applications menu.
The File Browser opens to the ~/.wine/dosdevices/c: directory.
A lot of the applications that work well in Wine are games, but there are other types of programs that are in the Platinum rating list, such as several Adobe programs and Amazon Kindle for the PC. Again, browse the Wine Application Database (http://appdb.winehq.org/) to see what programs work in Wine and how well they work.
For more information about using and configuring Wine, see the documentation at http://www.winehq.org/documentation.
by Lori Kaufman
