Running Linux, 5th Edition - Matthias Kalle Dalheimer [489]
The Appearance tab does not affect the running of applications, but just allows you to customize Wine's look. It loads Windows XP themes based on .msstyles files.
Windows programs are sandboxed within a contained filesystem environment. The settings within the Drives tab allow you to adjust how much of the underlying Linux filesystem can be seen by an application. This can prevent misbehaving Windows programs from affecting anything else on your system. Wine can modify only files that the Linux user running it can modify. By default, Wine sets up a special virtual Windows drive in ~/.wine/drive_c and installs Windows applications there. If you look at the drive mappings for your virtual C: drive, you'll see that they point to that location. If you would like to add another drive, click on the Add button and locate the Linux directory you'd like to access. For instance, if you have some removable media, you can add that mount point as a drive.
The final tab that controls audio settings is pretty self-explanatory. If you use the Autodetect button, it attempts to automatically figure out which one of Wine's audio drivers should be used. You can also set this manually using the drop-down box. If you have difficulty getting sound output, be sure to check the mixer settings within your distribution to make sure the volume on your audio device is turned up. Problems with audio are handled in Chapter 9.
In general, winecfg operates like Windows' control panels. It simply serves as a graphical interface to the underlying registry settings. And just as on Windows, you can configure these settings directly using the regedit tool. Just run regedit from the command line to open it. You'll find most of the settings we've discussed stored within the HKEY_CURRENT_USER\Software\Wine branch of the registry. For example, if you drill down through the hierachy using regedit, you'll see that the Windows version is stored directly in the key HKEY_CURRENT_USER\Software\Wine with a value of Version containing the data of the version, such as win98. regedit can also be useful for examining application settings. Usually these keys follow a naming convention like HKEY_LOCAL_MACHINE\Software\vendor\application.
The only configuration settings not stored in the registry are drives and ports. The changes made using the Drives tab are stored directly in the filesystem using a series of symbolic links. If you look in the ~/.wine/dosdevices directory, you'll see that each link points to the location within the filesystem to be accessed by the virtual drive. The default configuration will look something like this:
lrwxrwxrwx 1 wineuser wineuser 10 May 6 21:37 c: -> ../drive_c
lrwxrwxrwx 1 wineuser wineuser 1 May 6 21:37 z: -> /
Therefore, the virtual Windows drive c: points to ~/.wine/drive_c. The z: points to the root of your filesystem. Accessing ports is done in a similar manner, and you may find you need to add a symbolic link for com1 to something like /dev/ttyS0 in order to access the serial port. Of course, Wine will be able to access only the parts of your root filesystem that the user has access to.
Running Wine
To actually run applications, just invoke wine. First, locate the actual file you need to run. Most likely this means locating an installation program first. Generally the name will be something like SETUP.EXE or INSTALL.EXE. To run it, enter:
$ wine SETUP.EXE
The installation program should then execute and copy all of the files the program requires into your virtual Windows drive. It will also make any necessary registry changes. On Windows, this may mean setting up some special RunOnce registry keys that get executed when Windows reboots. The RunOnce keys will execute just that one time, but they typically perform actions necessary to set up a program for use. To simulate a reboot and execute these keys, run the wineboot command. Running that command really can't hurt anything, so you should always plan on running it after installing a program.
Once the program is installed, you need to locate