Installing Terraria/Steam in Wine

Today I had to rebuild my wine-prefix of Steam and re-install Terraria – the main reason to have Steam in the first place :D

The trouble was that I wanted to install Magicka. Magicka runs on .Net Framework version 3.5, while Terraria is using .Net Framework version 4.0. Unfortunately, the version 3.5 didn’t want to install. To be precise: 3.5 wanted to install 2.0 first, which didn’t install because 4.0 was already installed.

So I decided to create a fresh wine-prefix of Steam and install as much of .Net Frameworks as possible to not run into the same trouble later again. If you do not know what a “wine-prefix” is, have a look at the wiki page of winetricks – an awesome tool to make the usual trial & error work in wine much easier.

These are the steps I took. I usually create the prefix first in the default location:

WINEPREFIX=”~/.local/share/wineprefixes/steam” winecfg

This will download the current gecko engine for html rendering and provides the opportunity to set the screen resolution to 120dpi.

Next step is to install Steam itself:

winetricks steam

This will install the Steam client into the prefix I created above. Once that’s done I use winetricks to install a few libraries that I think are useful:

winetricks

In the GUI that pops up I “select steam (Steam)” and “Install a Windows DLL or component“:

Winetricks will download, extract and install all this stuff for you. So much easier than native Windows :D

This is usually the time I do the first backup of the wine-prefix. Feel free to do so now. Also, Wine should have created a start-menu entry for Steam. Run it now and install Terraria. Do not run/execute Terraria after the installation, though!

Next there is an important order in which to install the whole .Net Framework mess. Most important: Do not install any dotnet1.x!

First via winetricks: first dotnet20, then dotnet20sp2, then dotnet30, then dotnet35.

Then download .Net Framework 4.0 from here. Now, you can’t immediately install it because it would complain that it’s already installed. Weird default registry setting of modern wine. Let’s get rid of that via regedit so we can actually install it:

WINEPREFIX=”~/.local/share/wineprefixes/steam” wine regedit

Browse to HKLM\Software\Microsoft\NET Framework Setup\NDP\v4. Select the HKLM\Software\Microsoft\NET Framework Setup\NDP\v4\Full node and export it. You will need it later. Then delete the whole v4 node.

On first run the setup will fail. On the second run the setup will fail with a different message. If on the third run the setup asks you to repair the installation, it’s exactly what you are supposed to expect and press cancel.

Now it’s time to re-import the Full part. Run regedit again as mentioned above and import the file you saved it to previously.

Next step to get Terraria going is to install Microsoft’s XNA library. You should get the installation file when loading Terraria via Steam. Run it:

Now, for some reason Terraria cannot find the installed .NET Framework libraries at the place they got installed. You need to manually copy them to the folder which contains terraria.exe. Find the following following libraries in your wine-prefix somewhere and copy them to ~/.local/share/wineprefixes/steam/drive_c/Program Files/Steam/steamapps/common/terraria: