Wine ile Directx Kurulumu
Configure DirectX libraries
This is the most complicated step of all. But do not worry, you get everything, step by step.
Launch Wine configuration. You can either do it via the Application menu in your distro, Wine > Configure Wine or by running winecfg from the command line. Once the main menu opens, click on the Libraries tab.
This tab allows you to specify the behavior of different DLLs and override the possible defaults. To get DirectX running, you will need a long list of DLLs listed. The first step is to click on the New override dropdown box icon and expand the list. Search for the d3d8 DLL. Once found, click Add.
It will be added to the Existing overrides list like this: d3d8 (builtin,native). This is not what we need. Therefore, you must select the DLL in the list and click Edit. Then, change the configuration to builtin only.
There's a very long list of DLLs and specifying them manually would be a torture. Luckily, you can hack the Wine registry directly and add the desired overrides as a list into the file, without going through the manual process of specifying each one using the GUI. To edit the registry, open the file in text editor (e.g. gedit):
In the file, look for the section labeled DllOverrides:
In this section, you can copy & paste the entire list of DLL overrides required. You can find the entire list in thisgreat article. Copy the entire selection, save the file and exit. The next time you launch Wine configuration, the overrides will be loaded. Eventually, you'll see something like this:
This is the first step. Now, we need to setup some core files.
Setup core files
These files may or may not be required, but it does not hurt to have them anyway. The two files in question aremscoree.dll and streamci.dll. The first is a module containing .NET Framework functions, the second is a library used to install streaming hardware devices.
You can copy these files from your Windows installations, if you have some, or download them from the web. A good online source that offers these file is DLL-files.com.
In general, when you have to download DLLs or similar files from the web, it is always a good idea to stick to reputable sources, compare the file size and hash to those advertised by Microsoft and perhaps even upload the files to Jotti or VirusTotal for a perfunctory scan. You can also check the reputation of the website serving DLLs using a community service like Web of Trust (WOT). In this case, DLL-files gets a pretty decent score.
Anyhow, back to our topic, download the two files and copy them to the Wine system32 folder.
cp mscoree.dll ~/.wine/drive_c/windows/system32/
cp streamci.dll ~/.wine/drive_c/windows/system32/
The next step is to download the DirectX 9.0c redistributable package.
Download DirectX 9.0c
You need the redistributable package, because the installation won't handle the online installer well. Once the file is downloaded, run the executable with Wine. Note: Microsoft tends to change the download links now and then, so if the link above is broken, Google for it.
This will start a wizard, which will ask you to accept the license and extract the files to a folder. Choose any folder and extract the files there.
Install DirectX 9.0c
Navigate to the folder and run the actual DirectX setup:
The installer should complete without any problems. It will ask you to reboot, but you do not need to do that.
Test DirectX 9.0c
Now, let's test. Go to the system32 folder (inside the .wine folder) and run dxdiag.exe.
If everything went as it should, you should have DirectX setup and enabled. You can ignore most of the device and driver information, since we're doing a rather decent hack here.
Setup Direct Music
If you also want to have enhanced sound effects and whatnot, you will need another driver. The file in question is called gm.dls and you can find it listed on several websites, available for download. Again, use discretion when downloading files like this. Make sure they are digitally signed by Microsoft, with the proper size and hash value. Likewise, checking these files against Jotti or VirusTotal may not hurt. If you have Windows installed, look for the file on your machine. Copy the file to system32/drivers:
cp gm.dls ~/.wine/drive_c/windows/system32/drivers/
After doing this, rerun dxdiag and check the Music tab.
Setup additional files
Your games may also require additional DLLs that are not found above. You will discover this only after installing them and running them, which is the step below. If you have already found online references that mention additional DLLs are needed for your games, then you can install them before trying the game, saving yourself time.
For example, Tropico 3 requires d3dx9_41.dll, without which the game start will fail. The above subset includes only d3dx9_24.dll and d3dx9_36.dll, but not the latest one. No worries, head to DLL-files.com and download the missing item(s).
Install and test your games!
Time to try your games. In my case, Tropico 3 installed without any problems, followed by the 1.04 patch, which solves lots of issues in the original game. Starting the game without the d3dx9_41.dll resulted in a failure, but once I copied the missing item into the system32 folder, everything worked fine.
The game runs smoothly even on high level - considering the hacks we just did, this is impressive. The sound quality is great. The game is stable. It's really a pleasure. A real blast!
What more, you can make things faster even more!
Wine prints lots of debugging messages to the console, slowing things down a bit. You can definitely improve the performance by prepending a Wine debug environment variable to the wine command line, allowing yourself even more Frames Per Second (FPS) in your games.
Just run the game executable like this:
WINEDEBUG=-all wine <game-executable>
WINEDEBUG=-all wine Tropico3.exe
Microsoft DirectX is a collection of application programming interfaces for handling tasks related to multimedia, especially game programming and video, on Microsoft platforms. Originally, the names of these APIs all began with Direct, such as Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, and so forth. DirectX, then, was the generic term for all of these Direct-something APIs, and that term became the name of the collection. Over the intervening years, some of these APIs have been deprecated and replaced, so that this naming convention is no longer absolute. In fact, the X has caught on to the point that it has replaced Direct as the common part in the names of new DirectX technologies, including XAct, XInput, and so forth.
Direct3D (the 3D graphics API within DirectX) is widely used in the development of computer games for Microsoft Windows, Microsoft Xbox, and Microsoft Xbox 360. Direct3D is also used by other software applications for visualization and graphics tasks, most notably among the engineering sector for CAD/CAM, because of its ability to quickly render high-quality 3D graphics using DirectX-compatible graphics hardware. As Direct3D is the most widely recognized API in DirectX, it is not uncommon to see the name DirectX used in place of Direct3D.
This is with a clean configuration directory and running in a 1024x768 virtual desktop.
DirectX version installed: March 2008 DirectX 9.0c redistributable
Windows version emulated: 2000
Wine version tested: 0.9.58
Once the .wine directory is built the configuration tool will start and you can set a virtual desktop in the graphics tab if you wish. This is a good time to also set your Audio driver in the Audio tab.
next up is to install a native mscoree.dll and streamci.dll into /system32 from a windows install and set them to native Windows.
You will need to set a large number of dlls to native for the install to work properly. Here is the full list of dlls that needs to be set.
You can set all the dlls in winecfg under the "Libraries" tab or just set the first dll "d3d8"="builtin" and then go to .wine/user.reg and find the DLL override section [SoftwareWineDllOverrides] and copy the above list under it.
Download DirectX 9.0c March 2008 release from here.
The directx_mar2008_redist.exe executable will extract the installer files to a directory of your choice.
tom@tuxonfire ~ $ wine directx_mar2008_redist.exe
fixme:advapi:DecryptFileA "Z:hometomdx" 00000000
tom@tuxonfire ~ $
Now cd to the directory where you choose to extract the DirectX installer and run DXSETUP.EXE.
tom@tuxonfire ~ $ cd /home/tom/dx
tom@tuxonfire ~/dx $ wine DXSETUP.exe
Now we need to install gm.dls to test Direct Music, this driver file goes into ~/.wine/drive_c/windows/system32/drivers
Now lets run dxdiag.exe
tom@tuxonfire ~ $ cd /home/tom/.wine/drive_c/windows/system32
tom@tuxonfire ~/.wine/drive_c/windows/system32 $ wine dxdiag.exe
fixme:advapi:SetEntriesInAclA 1 0x33f79c (nil) 0x33f7d4
I have some screenshots of the DirectX test being run here: DirectX 9.0c on Linux with Wine they are the same, so why repost everything. ;)
You will notice in system32 d3dx9_24.dll up to d3dx9_36.dll is now installed, this really helps when you run into a game that needs these additional DirectX dlls.
Now you have the option to run most DirectX dlls in native or builtin mode, for example if you have a game that's crashing on the builtin Wine quartz.dll you can test the game with the native Windows dll to see if this will improve the situation.
Keep in mind d3d8, d3d9, ddraw will only work as builtin, and in most cases you should try to use builtin dsound and dinput. I have had limited success with (dsound and dinput) in native Windows mode btw... The reason why these dlls have to be used in builtin mode is there need for direct access to your hardware. direct music and direct play can be used in native windows mode in most circumstances.