Skip to content

Instantly share code, notes, and snippets.

@tonylambiris
Created May 13, 2019 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonylambiris/d4bdb174be8d7c3a835623f1e45c9f4d to your computer and use it in GitHub Desktop.
Save tonylambiris/d4bdb174be8d7c3a835623f1e45c9f4d to your computer and use it in GitHub Desktop.
Wine setup script
#!/bin/bash
TRICKS=()
TRICKS+=(corefonts)
TRICKS+=(dotnet462)
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 -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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment