Skip to content

Instantly share code, notes, and snippets.

@Ligh7bringer
Forked from tonylambiris/wine_gaming.sh
Created July 7, 2019 19:41
Show Gist options
  • Select an option

  • Save Ligh7bringer/ebf67c36a6999f000facef9d355d20bd to your computer and use it in GitHub Desktop.

Select an option

Save Ligh7bringer/ebf67c36a6999f000facef9d355d20bd to your computer and use it in GitHub Desktop.
Wine setup script for creating a minimalist gaming environment
#!/bin/bash
TRICKS=()
TRICKS+=(corefonts)
TRICKS+=(dotnet452)
#TRICKS+=(dotnet462)
#TRICKS+=(dotnet472)
TRICKS+=(vcrun2005)
TRICKS+=(vcrun2008)
TRICKS+=(vcrun2015)
test -z "$WINEPREFIX" && WINEPREFIX="${1:-$HOME/.wine}"
test -z "$WINEARCH" && WINEARCH="${2:-win64}"
if test -d "${WINEPREFIX}"; then
echo
echo "WARNING!"
echo "WARNING! This will wipe all data from \$WINEPREFIX to ensure a clean setup."
echo "WARNING! Ensure winetricks, wineasio and dxvk are installed before proceeding!"
echo "WARNING!"
echo
fi
echo "WINEARCH=${WINEARCH} WINEPREFIX=${WINEPREFIX}"
echo
read -p "Hit enter to continue..." ans; wineserver -ks
test -d "${WINEPREFIX}" && rm -rf "${WINEPREFIX}"
[[ "${WINEARCH}" == "win64" ]] && wine64 wineboot -i || wine wineboot -i
wineboot -r -f
test -w $(command -v winetricks) &>/dev/null && winetricks --self-update
set -e
for trick in "${TRICKS[@]}"; do
echo -n "Installing $trick, please wait..."
if winetricks --country=US --force -q "${trick}" 1>>/tmp/winetricks.log 2>>/tmp/winetricks.err; then
echo " ok"
else
echo " err"
fi
done
env WINEPREFIX="${WINEPREFIX}" regsvr32 wineasio.dll
env WINEPREFIX="${WINEPREFIX}" setup_dxvk install
wineserver -ks
echo "Configuring wine..."
echo
winecfg
setup="/tmp/Battle.net-Setup.exe"
test -f "$setup" || wget -c -O "$setup" \
'https://www.battle.net/download/getInstallerForGame?os=win&locale=enUS&version=LIVE&gameProgram=BATTLENET_APP'
wine "$setup"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment