Skip to content

Instantly share code, notes, and snippets.

@p4block
Last active Aug 27, 2021
Embed
What would you like to do?
FAF
# Modify to get the user folder
export WORKDIR="${HOME}/.faforever/linux"
export WINEPREFIX="${WORKDIR}/prefix"
export GAMEDIR="/mnt/hdd/Games/Supreme Commander Forged Alliance"
export PROTONVERSION="5.13-6-proton"
#export PROTONVERSION="6.3-4-proton"
export DXVKVERSION=1.9.1
# Useful environment variables
export WINEDLLOVERRIDES="mscoree,mshtml="
export DXVK_HUD=fps
export MANGOHUD=1
# Ensure this exists
mkdir -p "${WORKDIR}"
if [ -d "${WORKDIR}/wine" ]; then
echo "Wine already downloaded"
else
echo "Downloading wine"
# Enter temporary directory
TMP="$(mktemp -d)"
cd "${TMP}"
wget "https://github.com/Kron4ek/Wine-Builds/releases/download/$PROTONVERSION/wine-$PROTONVERSION-amd64.tar.xz"
tar xf *.tar.xz
rm *.tar.xz
mv "wine-$PROTONVERSION-amd64" "${WORKDIR}/wine"
# Get rid of temporary directory
rm -rf "${TMP}"
fi
export PATH="${WORKDIR}/wine/bin":"${PATH}"
# 2
# Create and prepare wine prefix
if [ -d "${WINEPREFIX}" ]; then
echo "Wine prefix already set up"
else
echo "Setting up wine prefix"
mkdir -p "${WINEPREFIX}"
# Enter temporary directory
TMP="$(mktemp -d)"
cd "${TMP}"
# Download winetricks and install dx9, even though it is unused due to dxvk
# This game is just weird
# Please reimplement in Spring engine
wget "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
chmod +x winetricks
./winetricks dlls d3dx9
./winetricks dlls xact
# Download DXVK
wget "https://github.com/doitsujin/dxvk/releases/download/v$DXVKVERSION/dxvk-$DXVKVERSION.tar.gz"
tar xzf dxvk-$DXVKVERSION.tar.gz
cd dxvk-$DXVKVERSION
./setup_dxvk.sh install
rm -rf "${TMP}"
fi
# 3
# Run game
cd "${GAMEDIR}"
wine64 "${HOME}/.faforever/bin/ForgedAlliance.exe" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment