Linux Class is in Session

Wine Prefixes, Winetricks and DLLs

11751603

In today’s Linux Lesson, I’m going to be teaching you all about Wine prefixes, Winetricks, and DLLs – plus maybe a couple more fun tidbits thrown in.

Why is this important?

Well, for any Windows game we play via Lutris, we do so within a “Wine prefix”. Understanding the structure of this prefix can be very beneficial to finding your way around Linux, understanding what to do when things go wrong, and will have a lot to do with setting up your Sim-tilities (which we will cover in another class!)

To give a brief overview: a Wine prefix is akin to a small and empty fake Windows system. Winetricks is a system for managing your Wine prefix, and DLLs are piece-meal bits of Windows software that you can install into your Wine prefix to help it run certain programs.

There now, I’ve just explained it all – you’re ready for the exam!

Let’s dive in a little deeper and go through what it helps to know about all of these different topics.

As in my introduction, my advice is to think of a Wine prefix as a mini “fake windows system”.

Windows users may be familiar with things such as

  • Your C:/ or c drive
  • Your “Program Files” where most programs are installed
  • Your “Documents” or “My Documents” folder, etc

Linux as an Operating System (OS) has some similar locations, such as Home / Documents, along with Pictures, Music, Downloads, etc. But within a wine prefix, these are usually* separate – more on caveats later.

When you set up a Wine prefix, you set up a small Windows file structure inside Home/Games, (unless you change the location while installing.. don’t do that, just complicates things lol). Inside of Home/Games/[Prefix], you will see familiar sights such as “drive_c”, inside which you can find Program Files, Program Files (x86) which is for 32-bit software, Users, etc. This is a self-contained “fake Windows”, separate to another Wine prefix’s drive_c and Program Files.

So when we install The Sims 2, we set up a Wine prefix usually called ‘the-sims-2’ or similar. This Wine prefix is going to become your home for most or all Sims 2 related programs and features on Linux. You want to run every Sims 2 related program inside this wine prefix so the files can all find and reference each other.

If or when your install another game into Lutris, perhaps The Sims 3, The Sims 4, or any other Windows game that needs help to run on Lutris, this will most likely have its own Wine prefix, unique and separate to the Sims 2 prefix.

This is how we find things inside Linux for The Sims 2 such as where the FunWithPets / SP9 / TSBin folder is, or where your “My Documents” is to put in your existing hoods and downloads.

The exact file path is going to depend on many things such as the version of the game you install, your username and more, but as a general example, the game install will be located in

Home/Games/the-sims-2/drive_c/ProgramFiles(x86)/The Sims 2 Starter Pack

The place to put your Downloads folder is going to be found in

Home/Games/the-sims-2/drive_c/users/[YOUR USERNAME]/Documents/EA Games.

Winetricks is a system for managing your Wine prefix. If you followed my video instructions closely, you will also have a Wine instance and Winetricks that is system-wide, which you can also install DLLs into to run across your entire system.

There are a few really important things to know about Winetricks:

  1. It likes to give you a tonne of pop-ups and notifications and errors while it’s doing things, most of which you can safely ignore. Like, probably 95% of them.
  2. It sometimes doesn’t run properly if you’ve got your game runner set to GE-Proton (more on runners in this post). It will also visually look different if the runner is set to Proton (white versus black) and give you a slightly different prefix path on screen 2, attaching /pfx to the end. This can sometimes bugger things up – if you’re using Winetricks via Lutris, I recommend setting the runner back to Wine.
  3. In general, I recommend using the terminal to run Winetricks over using Lutris, as appears to be much more stable.

You can launch into your sims 2 prefix from the terminal by entering:

“WINEPREFIX=~/Games/the-sims-2 winetricks” (remove quotation marks, and modify this to reflect your prefix name if requried)* Another small caveat here, go to final section for more info.

When you first open Winetricks, you generally want to click next and “select the default wine prefix”, unless instructed otherwise.

The next screen will show you which prefix is currently selected.

From within Winetricks we can do many things, including installing Windows fonts (option 2), changing settings (not recommended unless you know what you’re doing!), running winecfg where we can change the version of windows being emulated, and more!

What you’re going to use Winetricks for the most is installing DLLs, which we will cover in the next section, but for now it is important to know why you might see different “versions” of winetricks appearing at different times, and remember that running via the Linux Terminal rather than from within Lutris is the safest and best option in my experience.

DLL’s are small bits and pieces of Windows software that we can install into a Wine prefix (fake mini Windows) to help it to run different programs and games. Think of these a little bit like Windows dependencies, such as Directx, Microsoft Redistributable, or .NET frameworks. Without the right dependencies installed, Windows programs will fail to work.

I’m going to here give you a rundown on the DLL’s you may want to consider installing, depending on your needs.

For general use, I recommend installing

  • d3dx9
  • dotnet20
  • vcrun6

These will help most basic Windows programs to run.

Building onto that, if you’d like to use more modern tools (in particular, sim-tilities), I recommend then installing:

  • dotnet40
  • dotnet48
  • d3dx11_43
  • gdiplus (ESSENTIAL for SimPE)

Most of PickNMix’s Sims 2 tools such as Object Relocator, HCDU+, What Caused This, etc, require the later .NET frameworks to run.

If you plan on running ReShade in your Sims 2 game, I was told to install these DLLs:

  • d3dcompiler_43
  • d3dcompiler_47
  • msls31

I will cover ReShade in another post, but installing these DLLs will lay the groundwork for getting ReShade working on Linux (which yes, by the way, you can absolutely do!)

If you’d like to use Winetricks to install some Windows fonts so that program fonts “look right”, I recommend installing “Core Fonts” from the list in the ‘install a font’ section of Winetricks.

These pieces of Windows software will cover you for most things I’ve come across, but if you’re running into problems running a program in your prefix, check for error messages giving you a hint as to what you might need, ask Google for help (or ChatGPT if that’s your thing), and see if there are other dependencies you might be missing.

Here is how to speed-run a Sims 2 prefix setup, once the game is installed.

  1. ESSENTIAL: Right-click The Sims 2 in Lutris, select configure, go to the “Runner” tab and set it to Wine, NOT GE-Proton. We will change it back to Proton after this process, but for setting up prefixes I always recommend using Wine runner. Just trust me, it works better. Then close Lutris.
  2. Open the terminal, copy and paste this: WINEPREFIX=~/Games/the-sims-2 winetricks dotnet20 vcrun6 d3dx9 corefonts
    • If your prefix is not called the-sims-2, you must edit that part of the command
    • If the terminal tells you that Winetricks is not installed but CAN be installed with command sudo apt install winetricks, that’s good. Do that, then re-do that last command.
    • If you run into problems copy/pasting, the terminal only accepts right-click copy and right-click paste, no keyboard shortcuts.
    • If you have problems with Winetricks and the terminal for whatever reason, see Caveat 2 in the Caveats section.
  3. Let that complete. You should get a little Windows installer for installing dotnet20 – just click through and follow the prompts. It usually takes a couple of minutes to do it’s thing.
  4. If you only want to play TS2, you’re done.
  5. If you want ReShade, copy and paste this:
    WINEPREFIX=~/Games/the-sims-2 winetricks d3dcompiler_43 d3dcompiler_47 msls31
  6. That should complete within a few seconds. If you want to use SimPE, HCDU+, or any other sim-utility programs, next copy-paste in this: WINEPREFIX=~/Games/the-sims-2 winetricks dotnet40 d3dx11_43 gdiplus
  7. Let that complete – another installer should appear for dotnet40, once again just click through and let it complete
  8. Finally, we’re also going to install dotnet48 by entering: WINEPREFIX=~/Games/the-sims-2 winetricks dotnet48
  9. Done! Close the terminal, go back into Lutris, once again right-click The Sims 2 and select configure, go to runner options, and change back to GE-Proton – any version is fine.

Congrats! You’ve just set up a Sims 2 prefix. And by the way, this can be repeated with a different prefix name – which means yes, you can have multiple copies of The Sims 2 installed on Lutris. I have a completely separate prefix and install for my modern game (the-sims-2) versus medieval (sims-2-medieval). It’s nice! 😉

Unfortunately, there are sometimes caveats to this advice and process. So let’s take a look at some of those.

  1. I state that the Sims 2 Prefix’s “Documents” folder will be separate to Linux’s Documents folder. This ought to be the case in my experience, but sometimes Linux creates a “system link” between the 2 folders so they’re looking in the same place. I do not recommend this. Recent Lutris updates broke all system linked folders and many players panicked when their game was no longer locating their Downloads and Hoods. If you have this setup, I recommend removing the system link with the terminal.
    • Run this command to verify there is a symlink, replacing my username (beth) with yours and my prefix name (the-sims-2) with yours if it is different:
      • ls -l /home/Games/beth/the-sims-2/drive_c/users/beth/
    •  If you see something like this: Documents -> /home/beth/Documents that means there’s a symlink. Remove by entering (again replace usernames or prefix names where necessary!):
      • rm /home/Games/beth/the-sims-2/drive_c/users/beth/Documents
    • This will not remove your folder, only the symlink. But if you are nervous, backup the folder first. I sure did the first time I ran these commands 😂🙈
  2. I state that running Winetricks via the terminal is generally safer and much easier, and for 99% of my own experience and the people I’ve helped, that has been the case. But Linux loves a curveball lol. Recently I was helping my friend and fellow modder Gummilutt get set up on Linux, and her terminal just did NOT want to run Winetricks for her. She installed it, she updated it, she wiped it and reinstalled it, we re-did the prefix, it just WOULD NOT work. So in her case, we used Lutris’s built-in Winetricks, but still made sure that her runner was set to Wine and not GE-Proton for the setup. Sometimes you’ve just gotta make do with what you can!