From 0c05d98bc922ace3ef47ec09ec6a88194d90c117 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Sat, 9 Oct 2021 04:16:35 -0400 Subject: [PATCH] Download and cache latest version of winetricks. This insures that the latest version is being used, yes, even on Debian. lol This change should be considered experimental currently, it seems stable but if it proves otherwise it will be reverted. --- audiogame-manager.sh | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/audiogame-manager.sh b/audiogame-manager.sh index 0724dce..4af4133 100755 --- a/audiogame-manager.sh +++ b/audiogame-manager.sh @@ -181,12 +181,6 @@ checklist() { errorList+=("Critical: Wine is not installed. You will not be able to play any games.") fi packageList+=("wine") - if command -v winetricks &> /dev/null ; then - [[ $# -eq 0 ]] && echo "Winetricks is installed." - else - errorList+=("Critical: Winetricks is not installed. This means wine cannot be configured, dependancies cannot be installed, and only self-voicing games have any chance of working.") - fi - packageList+=("winetricks") if command -v curl &> /dev/null ; then [[ $# -eq 0 ]] && echo "Curl is installed." else @@ -442,6 +436,22 @@ echo "Loading documentation, please wait..." exit 0 } +winetricks() { + # Download or update agm's copy of winetricks + if [[ ! -e "${cache}/winetricks" ]]; then + checkWinetricksUpdate="true" + download "https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks" + chmod 700 "${cache}/winetricks" + else + if [[ "$checkWinetricksUpdate" != "true" ]]; then + checkWinetricksUpdate="true" + ${cache}/winetricks --self-update + fi + fi + # Run the requested winetricks parameters + ${cache}/winetricks "$@" +} + install_wine_bottle() { # 32 bit installations work best and are the default here, if you need to override it, do it in the game specific installation steps. export WINEARCH="${WINEARCH:-win32}" @@ -757,6 +767,7 @@ cache="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/cache" configFile="${XDG_CONFIG_HOME:-$HOME/.config}/storm-games/audiogame-manager/games.conf" mkdir -p "${cache}" mkdir -p "${configFile%/*}" +checkWinetricksUpdate="false" # Turn off debug messages export WINEDEBUG="-all" # Compatibility with box86