From 1ec6eb758f020dd7acf28e3236a9d83362af0bdb Mon Sep 17 00:00:00 2001 From: stormdragon2976 Date: Mon, 23 Jan 2023 18:08:56 -0500 Subject: [PATCH] First incarnation of a function to install different wine versions for audio games that require a specific version of wine to work. --- audiogame-manager.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index c40f698..3af3671 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -457,6 +457,31 @@ echo "Loading documentation, please wait..." exit 0 } +install_wine() { + # Requires wine version, e.g. 7.7 and architecture, 32|64 + if [[ $# -ne 2 ]]; then + exit 1 + fi + # Figure out wineInstallationPath + wineInstallationPath="${XDG_DATA_HOME:-$HOME/.local/share}/audiogame-manager/wine_$2/$1" + # If the path exists, wine should already be installed. + # Just make sure we didn't wind up with a empty directory for some reason + rmdir "${wineInstallationPath}" 2> /dev/null + if [[ -d "${wineInstallationPath}" ]]; then + return + fi + # This probably does not need to be cached, so download to tmp. + installationFile="$(mktemp)" + local v=$2 + v="${v/32/x86}" + v="${v/64/x64}" # Probably wrong, so just a place holder. + # If this goes wrong, bail out + set -e + curl -L --output "${installationFile}" "https://www.playonlinux.com/wine/binaries/phoenicis/upstream-linux-x86/PlayOnLinux-wine-${1}-upstream-linux-${v}.tar.gz" + tar xf "${installationFile}" -C "${wineInstallationPath}" + set +e +} + winetricks() { # Report used packages to the winetricks maintainer so he knows they are being used. if ! [[ -e "${XDG_CACHE_HOME:-$HOME/.cache}/winetricks/track_usage" ]]; then