Winetricks is a script meant to configure wineprefixes1). It is sometimes necessary to run Windows based games on Wine with additional dependencies that might get missed and therefore have to be added first manually by using Winetricks. Basically, with Winetricks, you can add those missing dependencies manually into an according existing wineprefix. Batocera has implemented Winetricks natively.

Note that every Windows game might have different missing dependencies when running on Wine. Therefore it is necessary to find out what additional dependencies (if any) are needed to make the according game run successfully on Wine. In most cases, to find out which winetricks to use to make a game run successfully in Wine, requires to search the internet, the which games section of the Windows games wiki page can be a start, however, sometimes the game will report a missing dll, in which case installing the winetrick containing it might be enough to fix it (for example, if a game complains about msvcp140.dll missing, we can see the trick vcrun2017 contains several dlls including that one, installing it can fix that specific issue).

The commands for Wine/Winetricks are different on Batocera than on other classic Linux distributions. The syntax for installing a winetrick into a wineprefix is as follows: 2)

batocera-wine windows tricks <absolute-path-to-the-wineprefix> <trick-to-install>

Note that you can only install one winetrick after another, so it is necessary to run the command from above multiple times if you have multiple winetricks to install.

As already mentioned above, it is necessary to find out what dependencies are needed to make a specific Windows game run successfully in Wine. For the game “Giana Sisters: Twisted Dreams” it was reported by different users that they made it run successfully by installing the following two winetricks: xact and wmp9. Since both winetricks are deprecated on the Wine version installed on Batocera, it's necessary to install other versions of the according winetricks, xact_x64 and wmp11 in this case. Generally, it's always worth a try to install other versions of the according winetricks if for some reasons Winetricks throws the according error(s)!

In order to find out what winetricks are actually available, navigate to the according section below.

First of all, it is necessary to either get the game's data as an installer or as raw binary files. For this example, the game is not installed on Batocera by using its installer but just copied the game's binaries to the according filesystem path at /userdata/roms/windows/Giana Sisters - Twisted Dreams.pc with the according autorun.cmd already set up (get more information about the autorun.cmd here). After updating the gamelist via the ES menu, the game accours on the WINE games list. In order to get Batocera creating the according wineprefix, the game has to be started manually once (where all ES specific game settings have to be left on default) via ES. Now the winefrefix is being created on the filesystem automatically at the following path:
/userdata/saves/windows/proton/Giana Sisters - Twisted
Be patient while you see the according blue screen, depending on Batocera's hardware it may take a while. Then, as the game is missing some dependencies, it will not start correctly and therefore it should crash and exit back to the ES desktop automatically (which is expected, so don't worry!). If it freezes instead, just exit manually by pressing Alt + F4 followed by End Process on the keyboard (sometimes you have to do it twice):

End Process

Now, from a remote PC, connect to the Batocera system via SSH in order to execute the according commands, required to install the missing dependencies via Winetricks.

  • First, to let the system become aware of your resolution settings, execute the following command:
    export DISPLAY=:0.0
  • Now set the Wine architecure (win32 for 32-bit or win64 for 64-bit) to the according game's architecure, 64-bit in this case:
    export WINEARCH=win64
  • Now you need to use batocera-wine with the tricks command as follows, which will install the first needed winetrick to the game's wineprefix (Note that if you have any whitespaces in your path you have to put the whole path into single quotes as in the following example):
    batocera-wine windows tricks '/userdata/saves/windows/proton/Giana Sisters - Twisted' xact_x64

    Now install the next winetrick:

    batocera-wine windows tricks '/userdata/saves/windows/proton/Giana Sisters - Twisted' wmp11

In case you run into the following error message…
warning: wine cmd.exe /c echo '%AppData%' returned empty string, error message “”
…it means the game is still stuck running somewhere in the background. This happens sometimes when the game gets forced to quit by pressing Alt + F4 followed by End Process as you might have done before. In such case just reboot Batocera by executing…

batocera-es-swissknife --reboot

…and then try again.

That was mostly it. Now as for Wine the game “Giana Sisters: Twisted Dreams” needs Vulkan in order to interact with the according DirectX graphics API, it is necessary to enable DXVK FEATURE in the ES game's Advanced Game Settings menu:


Now start the game via ES and have fun!

You can produce this information on your own by executing the following command:

/usr/wine/winetricks list-all

A static copy is below, last updated 08.10.2022.


Depending on the winetrick you want to install you may run into the issue that the system seems to freeze on the remote command line. Before giving up you should take a look on your Batocera screen. It may ask you to interact.
Example: If you want to install the vcrun2017 the system seems to freeze on the remote command line at this point:
0104:fixme:oleacc:find_class_data unhandled window class: L“Button”
So you may think it fails to install but instead there's the according package setup popping up on the Batocera GUI screen, waiting for you to interact:

Setup menu

In this case, just go through the setup process and you're done.

A wineprefix is the folder Batocera creates automatically on the filesystem when launching the installer on the game, or when launching a game for the first time, its name will end with .wine
You need to put the absolute path to the .wine folder, for example /userdata/saves/windows/lutris/ or /userdata/saves/windows/proton/ or /userdata/roms/windows/
  • emulators/winetricks.txt
  • Last modified: 6 months ago
  • by grandmabetty