Skip to content

Instantly share code, notes, and snippets.

@rdaysky
Created February 12, 2020 11:05
Show Gist options
  • Save rdaysky/f0f43e37ddefb18e5a73174b2da357d8 to your computer and use it in GitHub Desktop.
Save rdaysky/f0f43e37ddefb18e5a73174b2da357d8 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
here="$(dirname "$0")"
url="$(GET https://mtgarena.downloads.wizards.com/Live/Windows32/version | jq -r .CurrentInstallerURL)"
filename="${url##*/}"
if [ -e "$here/msi/$filename" ]
then
echo "$filename exists"
else
wget -O "$here/msi/$filename" "$url"
ln -sfn "$filename" $here/msi/latest.msi
fi
WINE_BIN=~/.local/share/lutris/runners/wine/lutris-mtga-4.21-x86_64/bin
export WINEPREFIX="$(realpath "$here/wineprefix")"
if [ -e "$WINEPREFIX" ]
then
echo "WINEPREFIX=$WINEPREFIX already exists"
exit 3
fi
cp -a --reflink "$here/wineprefix.prereq" "$WINEPREFIX"
$WINE_BIN/msiexec /i "$here/msi/latest.msi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment