Установка DirectX 9.0c на Linux с помощью Wine

Warning

It seems that many people have problems following this guide. So we sure that you are using the last version of Wine.

For Ubuntu 8.04 Hardy Heron, use :

sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/hardy.list -O /etc/apt/sources.list.d/hardy-winehq.list
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo apt-get update

For Ubuntu 7.10 Gutsy Gibbon, use :

sudo wget http://wine.budgetdedicated.com/apt/sources.list.d/gutsy.list -O /etc/apt/sources.list.d/gutsy-winehq.list
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
sudo apt-get update

You will now be able to install the last version of Wine with apt-get.

Wine environment setup

First, we install needed softwares:

/usr/bin/sudo /usr/bin/apt-get install wine cabextract wget

We create the Wine environment folder:

/usr/bin/wineprefixcreate

We configure the sound so that Wine use ALSA:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/audio.reg \
    --output-document=/tmp/audio.reg
/usr/bin/regedit /tmp/audio.reg

Video memory amount setup

We must tell Wine the amount of Video memory present on our graphic adapter. First, download the template registry file:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/video_ram.reg \
    --output-document=/tmp/video_ram.reg

We update the template with a auto-detected value that should fit to our system (if you have more than 256 MB of Video memory, the auto-detected value will only be of 256 MB):

/usr/bin/lspci | /bin/grep VGA | /bin/sed -e 's/^\([^ ]* \).*/\1/' \
    | /usr/bin/xargs -iPCIID /bin/sh -c "/usr/bin/lspci -v -s PCIID" \
    | /bin/grep Memory | /bin/sed -e 's/.*size=\([0-9]*\).*/\1/' \
    | /usr/bin/sort -g | /usr/bin/tail -n1 \
    | /usr/bin/xargs -iVIDEORAM /bin/sed -i -e 's/VIDEO_RAM/VIDEORAM/' /tmp/video_ram.reg

And we insert the corresponding registry key into Wine registry:

/usr/bin/regedit /tmp/video_ram.reg

DOS memory space access

In Ubuntu 8.04 Hardy Heron, access to the beginning of memory space is disabled for security reasons. For some old games (Caesar III for exemple), this access is needed. To allow access to this memory area, une these command lines:

/usr/bin/sudo /bin/cp /etc/sysctl.conf /etc/sysctl.conf.back
/usr/bin/sudo /bin/sed -i -e 's/^\(vm.mmap_min_addr =\) .*/\1 0/' /etc/sysctl.conf
/usr/bin/sudo /sbin/sysctl -p

DirectX installation

Once Wine configured, we download some files needed to install DirectX:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/mscoree.dll \
     --output-document=$HOME/.wine/drive_c/windows/system32/mscoree.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/streamci.dll \
     --output-document=$HOME/.wine/drive_c/windows/system32/streamci.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/gm.dls \
     --output-document=$HOME/.wine/drive_c/windows/system32/drivers/gm.dls

And we register DirectX DLLs as native in the registry:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/directx.reg \
    --output-document /tmp/directx.reg
/usr/bin/regedit /tmp/directx.reg

We download DirectX 9.0c installer:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/directx_mar2008_redist.exe \
     --output-document=/tmp/directx_redist.exe

We extract its contents:

/bin/mkdir $HOME/.wine/drive_c/DIRECTX
/usr/bin/cabextract -d $HOME/.wine/drive_c/DIRECTX /tmp/directx_redist.exe

And we install DirectX 9 :

/usr/bin/wine "C:\DIRECTX\DXSETUP.exe"

You can now test your installation by running dxdiag:

/usr/bin/wine "C:\windows\system32\dxdiag.exe"

Note: The test is to actually run dxdiag, don’t expect all tests runned by this software to work.

Once the install done and tested, we can do a little clean up:

/bin/rm /tmp/directx_redist.exe
/bin/rm -r $HOME/.wine/drive_c/DIRECTX

HTML renderer install

This step is mandatory for installing Source games (Half-Life 2, Counter Strike, etc…):

First, download WineTricks :

/usr/bin/wget http://www.kegel.com/wine/winetricks \
    --output-document=$HOME/.wine/winetricks

Then install Gecko HTML render with this command line:

/bin/sh $HOME/.wine/winetricks gecko

Now, test your installation with:

/usr/bin/wine "C:\Program Files\Internet Explorer\IEXPLORE.EXE" http://appdb.winehq.com/

Active Movie installation

Active Movie is needed for displaying video for some games. First, dowload the DLL file needed to install this software:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/dciman32.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/dciman32.dll

And download the Active Movie installer:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/amov4ie.exe \
     --output-document=/tmp/amov4ie.exe

Install Active Movie:

/usr/bin/wine /tmp/amov4ie.exe

And configure wine to use natively the amstream DLL:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/amstream.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/amstream.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/active_movie.reg \
    --output-document=/tmp/active_movie.reg
/usr/bin/regedit /tmp/active_movie.reg

And registrer this DLL in the registry:

/usr/bin/regsvr32 "c:\windows\system32\amstream.dll"

QuickTime installation

QuickTime is needed to display videos in some games, such as Myst, RHEM 2, etc. First, download the QuickTime 6.5.2 installer:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/quicktimefullinstaller-6-5-2.exe \
    --output-document=/tmp/quicktimefullinstaller-6-5-2.exe

And run it:

/usr/bin/wine /tmp/quicktimefullinstaller-6-5-2.exe

At the end of the install, your screen black out (at least, it is what it does on my computer). Don’t worry, it is a little display bug. We are going to solve it. Launch the QuickTime settings software:

/usr/bin/wine "c:\windows\system32\rundll32.exe" shell32.dll,Control_RunDLL QuickTime.cpl

And change the following parameters:

  • In section «Browser Plug-in», uncheck «QuickTime system tray icon».
  • In section «Video Settings», choose «Save Mode (GDI Only)».

You can now close the QuickTime settings.

Internet Explorer 6 installation

Warning: This is NOT recommanded. It is there because I need it for testing.

First, move the files that can create problems when installing:

/bin/mv $HOME/.wine/drive_c/Program\ Files/Internet\ Explorer/iexplore.exe $HOME/.wine/drive_c/Program\ Files/Internet\ Explorer/iexplore.exe.back
/bin/mv $HOME/.wine/drive_c/windows/system32/mshtml.dll $HOME/.wine/drive_c/windows/system32/mshtml.dll.back
/bin/mv $HOME/.wine/drive_c/windows/system32/shdoclc.dll $HOME/.wine/drive_c/windows/system32/shdoclc.dll.back
/bin/mv $HOME/.wine/drive_c/windows/system32/shdocvw.dll $HOME/.wine/drive_c/windows/system32/shdocvw.back
/bin/mv $HOME/.wine/drive_c/windows/system32/shlwapi.dll $HOME/.wine/drive_c/windows/system32/shlwapi.dll.back
/bin/mv $HOME/.wine/drive_c/windows/system32/urlmon.dll $HOME/.wine/drive_c/windows/system32/urlmon.dll.back
/bin/mv $HOME/.wine/drive_c/windows/system32/wininet.dll $HOME/.wine/drive_c/windows/system32/wininet.dll.back

And setup the registry keys needed for the install to run correctly:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/ie6.reg \
    --output-document=/tmp/ie6.reg
/usr/bin/regedit /tmp/ie6.reg

We download the Internet Explorer 6 installer, and we run it:

/usr/bin/wget http://download.microsoft.com/download/ie6sp1/finrel/6_sp1/W98NT42KMeXP/EN-US/ie6setup.exe \
    --output-document=$HOME/.wine/drive_c/ie6setup.exe
/usr/bin/wine "C:\ie6setup.exe"

Now, we register the newly installed DLLs (you need to repeat two times the same command):

for i in $HOME/.wine/drive_c/windows/system32/*.dll $HOME/.wine/drive_c/windows/system32/*.ocx; do /usr/bin/regsvr32 /i $i; done
for i in $HOME/.wine/drive_c/windows/system32/*.dll $HOME/.wine/drive_c/windows/system32/*.ocx; do /usr/bin/regsvr32 /i $i; done

Note: Ignore errors shown by this two commands.

Once this done, we install the msls31.dll file:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/msls31.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/msls31.dll

You can now run Internet Explorer with this command line:

/usr/bin/wine iexplore.exe

Going deeper

If you want to go further into Wine configuration, I encourage you to read:

Games

Guild Wars

First, download the game installer:

/usr/bin/wget http://www.guildwars.com/downloads/gwsetup.zip \
    --output-document=$HOME/.wine/drive_c/gwsetup.zip

Uncompress it:

/usr/bin/unzip -d $HOME/.wine/drive_c/ $HOME/.wine/drive_c/gwsetup.zip

Download the optimized settings for Guild Wars and add them to the Wine registry:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/guild_wars.reg \
    --output-document /tmp/guild_wars.reg
/usr/bin/regedit /tmp/guild_wars.reg

Now, install Guild Wars:

/usr/bin/wine "C:\GwSetup.exe"

Once this install done, you can go slash some monsters 😀 (arrrgh, I’m waiting for Diablo III to show up !).

Civilization IV

First, download WineTricks:

/usr/bin/wget http://www.kegel.com/wine/winetricks \
    --output-document=$HOME/.wine/winetricks

And use it to install Microsoft XML 3:

/bin/sh $HOME/.wine/winetricks msxml3

Then, install Civilization IV from the game CD-Rom. And download patch 1.74:

wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/civilization_iv_patch_v1-74_multi-langues_40669.exe \
     --output-document=/tmp/civilization_iv_patch_v1.74_multi-langues_40669.exe

And install it:

/usr/bin/wine /tmp/civilization_iv_patch_v1.74_multi-langues_40669.exe

Steam

Steam allow you to install Half-Life 2, Counter Strike, etc. In order to make Steam work, you need the Gecko HTML renderer:

First, download WineTricks :

/usr/bin/wget http://www.kegel.com/wine/winetricks \
    --output-document=$HOME/.wine/winetricks

And use it to install the Gecko HTML renderer:

/bin/sh $HOME/.wine/winetricks gecko

Download the Steam installer:

/usr/bin/wget http://steampowered.com/download/SteamInstall_French.msi \
    --output-document=$HOME/.wine/drive_c/SteamInstall_French.msi

And run it:

/usr/bin/msiexec /i $HOME/.wine/drive_c/SteamInstall_French.msi

Once the install done, you can delete the Steam installer:

/bin/rm  $HOME/.wine/drive_c/SteamInstall_French.msi

You can now apply the registry settings for the Source engine (for Half-Life 2, Counter Strike, Source, Day of Defeat Source, Portal, etc…):

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/hl2.reg \
    --output-document /tmp/hl2.reg
/usr/bin/regedit /tmp/hl2.reg

You can now install Half-Life 2, Counter Strike Source, Day of Defeat, Portal, etc…

Trackmania Nations Forever

To run Trackmania Nations Forever, first, apply registry settings for this game:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/tmforever.reg \
    --output-document /tmp/tmforever.reg
/usr/bin/regedit /tmp/tmforever.reg

Once this done, install the game with Steam.

Once the installation done, replace the file wrap_oal.dll
in order to get the sound to work:

/bin/mv $HOME/.wine/drive_c/Program\ Files/Steam/steamapps/common/trackmania\ nations\ forever/wrap_oal.dll $HOME/.wine/drive_c/Program\ Files/Steam/steamapps/common/trackmania\ nations\ forever/wrap_oal.dll.back
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/wrap_oal.dll \
    --output-document=$HOME/.wine/drive_c/Program\ Files/Steam/steamapps/common/trackmania\ nations\ forever/wrap_oal.dll

Crimson Skies

Crimson Skies needs you to install Active Movie. The install of this software is described earlier in this article.

You also need to install the native imm32 DLL:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/imm32.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/imm32.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/cskies_install.reg \
    --output-document=/tmp/cskies_install.reg
/usr/bin/regedit /tmp/cskies_install.reg

Once this done, install the game from the CD-Rom with this command line:

/usr/bin/wine /media/C_SKIES/install.exe

And download a NO-CD patch, the game can not work without it:

/bin/mv $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/crimson.exe $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/crimson.exe.back
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/crimson.exe \
    --output-document=$HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/crimson.exe

Now, we copy some files from the CD-ROM so that we can run the game without errors:

/bin/mkdir $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/LAUNCHER
/bin/cp /media/C_SKIES/install.exe $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/LAUNCHER/
/bin/cp /media/C_SKIES/setupenu.dll $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/LAUNCHER/

To run the game, use the following command line, or a error message about broken database will show up:

/usr/bin/wine "C:\Program Files\Microsoft Games\Crimson Skies\LAUNCHER\install.exe"

Note: The mouse cursor is quite bogus in the menus. On my own, I get it to the target by doing great circular mouvements.

Once you have seen the introduction video, I encourage you to delete it, since i’ve found no way to bypass it. Without doing this, you will lost 3 minutes each time you launch the game:

/bin/rm $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/GOSDATA/ASSETS/GRAPHICS/MPG/msopen1.mpg
/bin/rm $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/GOSDATA/ASSETS/GRAPHICS/MPG/zipper.mpg
/bin/rm $HOME/.wine/drive_c/Program\ Files/Microsoft\ Games/Crimson\ Skies/GOSDATA/ASSETS/GRAPHICS/MPG/chap0.mpg

RHEM 2

RHEM 2 needs you to install QuickTime as described earlier in this article.

Once this done, install the game using for exemple the following command line (if it does not work, launch the «setup.exe» from the «setup» folder on the CD-ROM).

/usr/bin/wine /media/cdrom/setup/setup.exe

and download the No-CD Patch. The game is using the Starforce 2 protection (thank you, Micro Application… ), and it can not work without such a patch.

Supreme Commander

Warning: GPGNet work only since Wine 0.9.60.

Warning: GPGNet does not work well. But i’ve manage to get automatic updates to work. But do not expect to enter internet games with GPGNet. This install guide is not complete and it does not seems that completing it is possible in the actual state of Wine.

First, download WineTricks :

/usr/bin/wget http://www.kegel.com/wine/winetricks \
    --output-document=$HOME/.wine/winetricks

Install the Gecko HTML render:

/bin/sh $HOME/.wine/winetricks gecko

Install Flash:

/bin/sh $HOME/.wine/winetricks flash

Install Dot Net 2.0 framework:

/bin/sh $HOME/.wine/winetricks dotnet20

Install Visual Java #:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/vjredist.exe \
    --output-document=/tmp/vjredist.exe
/bin/mkdir $HOME/.wine/drive_c/VISUALJAVA
/usr/bin/cabextract -d $HOME/.wine/drive_c/VISUALJAVA /tmp/vjredist.exe
/usr/bin/wine "C:\VISUALJAVA\install.exe"

Once this done, you can do a little clean up:

/bin/rm /tmp/vjredist.exe
/bin/rm -fr $HOME/.wine/drive_c/VISUALJAVA

We now download some DLLs:

/bin/mv $HOME/.wine/drive_c/windows/system32/shdocvw.dll $HOME/.wine/drive_c/windows/system32/shdocvw.dll.back
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/shdocvw.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/shdocvw.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/shlwapi.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/shlwapi.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/msimtf.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/msimtf.dll
/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/msctf.dll \
    --output-document=$HOME/.wine/drive_c/windows/system32/msctf.dll

And we setup Wine to use them as native:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/gpgnet.reg \
    --output-document /tmp/gpgnet.reg
/usr/bin/regedit /tmp/gpgnet.reg

We now install the game from the CD-ROM.

Then, run GPGNet with the following command line.Login and let the software update itself. Run GPGNet as many times as necessary.

/usr/bin/wine "C:\Program Files\THQ\Gas Powered Games\GPGNet\GPG.Multiplayer.Client.exe"

Use this command until GPGNet version is
1.5.188.1. Since this version, GPGNet crash just after login. To correct this problem, we install a missing DLL:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/gpg-multiplayer-plugin.dll \
    --output-document=$HOME/.wine/drive_c/Program\ Files/THQ/Gas\ Powered\ Games/GPGNet/GPG.Multiplayer.Plugin.dll

Then, when GPGNet version is the last one, login to a Supreme Commander session in order to get all the game updates.

Next, in order to get Supreme Commander sound, you need to install more DLLs:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/xactengine-dlls-tar.bz2 \
    --output-document=/tmp/xactengine-dlls-tar.bz2
/bin/tar --directory $HOME/.wine/drive_c/windows/system32/ -xjf /tmp/xactengine-dlls-tar.bz2
/usr/bin/regsvr32 $HOME/.wine/drive_c/windows/system32/xactengine2_*.dll

And apply some optimizations for Supreme Commander in the Wine registry:

/usr/bin/wget http://howto.landure.fr/gnu-linux/installer-directx-9-0c-avec-wine/spc.reg \
    --output-document /tmp/spc.reg
/usr/bin/regedit /tmp/spc.reg

You can now play to Supreme Commander on local network.

Wine environment reset

Warning : THE FOLLOWING COMMAND LINES DELETE ALL OF YOUR WINE ENVIRONMENT. This include:

  • YOUR GAMES BACKUPS

  • YOUR GAMES INSTALLS

  • YOUR TRICKS

EVERYTHING THAT NEED WINE OR IS ABOUT WINE.

USE THESE COMMAND LINES AT YOUR OWN RISKS:

rm -fr ~/.wine
rm -r ~/.local/share/desktop-directories/wine-*
rm -r ~/.config/menus/applications-merged/wine-*
rm -r ~/.local/share/applications/wine/

Thanks


2 комментария для “Установка DirectX 9.0c на Linux с помощью Wine”

Оставьте комментарий