UIAutomationCore Fix

Fix for UIAutomationCore.dll error on Linux with Streamer.bot v1.0.5 or later

JoacoSlime
Guide provided by JoacoSlime in the #linux-mac-os channel on Discord

Since the problem is caused by wine's incomplete UIAutomationCore implementation, there are two ways to fix it

You will need to get the UIAutomationCore.dll file from C:\Windows\System32\UIAutomationCore.dll.

  • If you have dual boot or another computer with windows 10 or 11 available, then you can copy the file from there to the prefix's drive_c/Windows/System32
  • If the options above are not available, then you can download a clean Win 10 ISO from Microsoft and use that:
    1. Download the ISO from: https://www.microsoft.com/en-us/software-download/windows10ISO
    2. Either use the attached UIAC.sh script to extract the file (requires p7zip) OR do the following:
    3. Mount the Win 10 ISO and go to the sources folder inside OR extract install.wim using p7zip: 7z e ISO_PATH sources/install.wim
    4. Either mount the install.wim file using wimlib and copy the file from Windows/System32/UIAutomationCore.dll OR extract the file using p7zip 7z e install.wim 1/Windows/System32/UIAutomationCore.dll

Depending on how you installed Streamer.Bot, the location of where you have to place the obtained file varies:

  • Using Lutris: Go to Game options, go to the directory set in Wine Prefix, then go to drive_c/windows/system32.
  • Using Bottles: Inside the SB bottle, click the Browse C:/ drive option, then go to windows/system32.
  • Using the install script: ~/.local/lib/streamer.bot/pfx/drive_c/windows/system32
UIAC.sh
#!/bin/bash
# Saving the script directory
DIR=$(pwd)

# Changing to a temporal working directory
cd "$(mktemp -d)" || echo Error changing to a temporal directory, \
        will use the script directory instead.

# Verifing that we have a working environment

if ! command -v 7z &>/dev/null; then
    echo Install the needed package: p7zip
    echo Fedora: sudo dnf install p7zip
    echo Debian/Ubuntu: sudo apt-get install p7zip-full
    exit 1
fi

# Asking for the ISO file
echo Insert the path to the Windows ISO file:
read -r ISO_PATH
ISO_PATH=$(realpath "$ISO_PATH") # Solving path, just because
echo

echo Extracting install.wim...
# Getting the install.wim from the ISO
if ! 7z e "$ISO_PATH" sources/install.wim &>/dev/null; then
    echo An error ocurred extracting the Windows installation file.
    exit 1
fi
echo

echo Extracting UIAutomationCore.dll...
# Get the UIAutomationCore.dll from the .wim
if ! 7z e install.wim 1/Windows/System32/UIAutomationCore.dll &>/dev/null; then
    echo An error ocurred extracting UIAutomationCore.dll from the installation file.
    exit 1
fi
echo

# Move the file where the script is called from and clean the directory
mv UIAutomationCore.dll "$DIR/UIAutomationCore.dll"
rm install.wim

echo "Done! UIAutomationCore.dll was extracted and moved to $DIR/UIAutomationCore.dll"
This method might cause audio and/or performance problems since we won't be using Proton fixes.
For both Lutris and Bottles, you have to manage and install other runners than the default if you haven't already.

Depending on how you installed Streamer.Bot, the way of changing the wine version used is different:

  • Using Lutris, change the runner (in runner options) to either:
    • wine 11.14 staging
    • System (if it's 11.9 or newer)
  • Using Bottles, change the runner to either:
    • kron4ek's 11.14 staging or newer (NOT tkg, Recomended)
    • Built-in wine 11 or newer
    • kron4ek's 11.14 staging tkg or newer
  • Using the install Script:
    • Check that your wine version is 11.9 (staging) or newer (use wine --version), if it's not, then you'll have to update wine, use your distribution's way of doing that or follow winehq guide to add their repos.