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