Affinity Wine Documentation

Wineprefix setup

Setting up your Wineprefix

Refer to the "Wine User Guide documentation" for more information about using Wine.

A Wineprefix is a directory containing a virtual C: drive, along with .reg configuration files for this specific "prefix".

Note

This guide will use ~/.wineAffinity3 as a wineprefix directory and it needs to be specified with the environment variable WINEPREFIX, like so:

WINEPREFIX="$HOME/.wineAffinity3" <command>

$HOME/ may need to be replaced by your full home directory path /home/USERNAME/ in order to make it absolute. This is a common issue with non-POSIX compliant shells.

  1. Create a Wineprefix:

    Because you want to avoid conflicts with an already existing one.

    WINEPREFIX="$HOME/.wineAffinity3" wineboot --init
    

    It might flash stuff in the terminal, most are simply warning, you can most likely proceed with the rest.

  2. Install dependencies with winetricks:

    Affinity needs dotnet and a few things that you can install/set with winetricks

    WINEPREFIX="$HOME/.wineAffinity3" winetricks --unattended --force remove_mono vcrun2022 dotnet48 corefonts win11
    
  3. Run any Affinity installer .exe with rum:

    WINEPREFIX="$HOME/.wineAffinity3" wine [Path to the installer].exe
    

    Warning

    You absolutely need to download the .exe installer, other ones won't be able to start.

  4. Get & copy the .winmd and wintypes.dll files:

    One of reasons we needed to use a fork of wine for so long is because Affinity wansn't able to resolve .winmd files.
    Now instead of relying on a fork, ElementalWarrior made it a little tiny dll file, loading when affinity starts and allowing it to resolve those dependencies.

    Download them with:

    curl --output "wintypes.dll" --follow https://github.com/ElementalWarrior/wine-wintypes.dll-for-affinity/raw/refs/heads/master/wintypes_shim.dll.so
    curl --output "Windows.winmd" --follow https://github.com/microsoft/windows-rs/raw/master/crates/libs/bindgen/default/Windows.winmd
    

    Copy the wintypes.dll to the Affinity install directory:

    cp "wintypes.dll" "$HOME/.wineAffinity3/drive_c/Program Files/Affinity/Affinity/"
    

    Copy the Windows.winmd to the WinMetadata dir:

    # You may need to create it
    cp "Windows.winmd" "$HOME/.wineAffinity3/drive_c/windows/system32/WinMetadata/"
    
  5. Launch Affinity:

    WINEPREFIX="$HOME/.wineAffinity3" wine "$HOME/.wineAffinity3/drive_c/Program Files/Affinity/Affinity/Affinity.exe"
    
  6. Troubleshooting


You can navigate to the next part with the sidemenu.