From 23285bd273ee750f5839b67a6a65b8381dd3e0e7 Mon Sep 17 00:00:00 2001 From: famfo Date: Fri, 29 Dec 2023 21:31:23 +0100 Subject: [PATCH 1/3] Fix script for commands not being in /usr/bin, use protontricks if winetricks is not found --- Arma3Helper.sh | 49 +++++++++++++++++++++++++++++++++++++------------ version | 2 +- 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Arma3Helper.sh b/Arma3Helper.sh index 59e6182..92ca7f7 100755 --- a/Arma3Helper.sh +++ b/Arma3Helper.sh @@ -5,8 +5,8 @@ # Contributing: famfo (famfo#0227) # Testing: G4rrus#3755 # -# Version 1v18-5 -_SCRIPTVER="1v18-5" +# Version 1v18-6 +_SCRIPTVER="1v18-6" ##################################################################################### ## Adjust below or use the external config file @@ -14,8 +14,8 @@ _SCRIPTVER="1v18-5" ## MAKE SURE YOU CHOOSE THE SAME PROTON VERSION AS FOR ARMA IN STEAM!!! # Set this to the Proton Version you are using with Arma! -# Available versions: "7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" -# Defaults to: 7.0 +# Available versions: "8.0 7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" +# Defaults to: 8.0 PROTON_OFFICIAL_VERSION="" ## Path to Arma's compatdata (wineprefix) @@ -61,6 +61,13 @@ fi ## FUNCTIONS # Installed check ($1 = path; $2 = name in error msg) _checkinstall() { + if [[ ! $(command -v $1) ]]; then + echo -e "\e[31mError\e[0m: $1 is not installed!" + exit 1 + fi +} +# Installed check by path ($1 = path; $2 = name in error msg) +_checkpath() { if [[ ! -x "$1" ]]; then echo -e "\e[31mError\e[0m: $2 is not installed!" exit 1 @@ -75,6 +82,22 @@ _confirmation() { exit 1 fi } +# Get the command to modify the protonprefix +_get_wrappercmd() { + no_winetricks=$(_checkinstall "winetricks") + no_protontricks=$(_checkinstall "protontricks") + wrappercmd="" + + if [[ $no_winetricks && $no_protontricks ]]; then + echo -e "$no_winetricks\n$no_protontricks" + exit 1 + fi + if [[ $no_winetricks ]]; then + echo "protontricks 107410" + else + echo "winetricks" + fi +} ## ENVIROMENTAL VARAIBLES if [[ -z "$COMPAT_DATA_PATH" ]]; then @@ -97,7 +120,7 @@ if [[ $PROTON_OFFICIAL_VERSION == "Proton Experimental" || $PROTON_OFFICIAL_VERS PROTON_OFFICIAL_VERSION="- Experimental" IS_EXPERIMENTAL=true elif [[ -z $PROTON_OFFICIAL_VERSION ]]; then - PROTON_OFFICIAL_VERSION="7.0" + PROTON_OFFICIAL_VERSION="8.0" fi # Executable paths @@ -114,7 +137,7 @@ fi # Start if [[ -z $* ]]; then # Check if TS is installed - _checkinstall "$TSPATH" "TeamSpeak" + _checkpath "$TSPATH" "TeamSpeak" if ! pgrep -i arma3.exe && ! pgrep -i arma3_x64.exe ; then echo -e "\e[31mArma should be started first!\e[0m \n" exit 1 @@ -160,21 +183,23 @@ elif [[ $1 = "debug" ]]; then # Winetricks wrapper for Arma's compatdata elif [[ $1 = "winetricks" ]]; then echo "Executing winetricks inside Arma's compatdata prefix..." - _checkinstall "/usr/bin/winetricks" "winetricks" + wrappercmd=$(_get_wrappercmd) + echo "Using \"$wrappercmd\"" export WINEPREFIX="$COMPAT_DATA_PATH/pfx" if [[ $2 = "Arma" ]]; then echo "Installing recommended features/DLLs for Arma" - winetricks d3dcompiler_43 d3dx10_43 d3dx11_43 xact_x64 + $wrappercmd d3dcompiler_43 d3dx10_43 d3dx11_43 xact_x64 echo "done" else - echo "Winetricks Arguments: ${*:2}" - winetricks "${*:2}" + echo "Arguments: ${*:2}" + $wrappercmd "${*:2}" fi elif [[ $1 = "winecfg" ]]; then echo "Starting winecfg via winetricks for Arma's compatdata..." - _checkinstall "/usr/bin/winetricks" "winetricks" + wrappercmd=$(_get_wrappercmd) + echo "Running $wrappercmd winecfg" export WINEPREFIX="$COMPAT_DATA_PATH/pfx" - winetricks winecfg + $wrappercmd winecfg # Updater elif [[ $1 = "update" ]]; then echo -e "\e[31mUpdating the script will reset your changes in the script options!\e[0m" diff --git a/version b/version index c9cb59c..d2f71f9 100644 --- a/version +++ b/version @@ -1 +1 @@ -1v18-5 \ No newline at end of file +1v18-6 From 8929ad7d991de4fec975198acccc6b66d6acf45e Mon Sep 17 00:00:00 2001 From: famfo Date: Fri, 29 Dec 2023 21:35:35 +0100 Subject: [PATCH 2/3] Fix shellcheck --- Arma3Helper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Arma3Helper.sh b/Arma3Helper.sh index 92ca7f7..ae14575 100755 --- a/Arma3Helper.sh +++ b/Arma3Helper.sh @@ -61,7 +61,7 @@ fi ## FUNCTIONS # Installed check ($1 = path; $2 = name in error msg) _checkinstall() { - if [[ ! $(command -v $1) ]]; then + if [[ ! $(command -v "$1") ]]; then echo -e "\e[31mError\e[0m: $1 is not installed!" exit 1 fi From aa50ae39e1d28422c2237c093be4d91293feae9c Mon Sep 17 00:00:00 2001 From: Ingo Reitz Date: Sat, 30 Dec 2023 01:25:18 +0100 Subject: [PATCH 3/3] minor comment fix + config file --- Arma3Helper.sh | 2 +- config | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Arma3Helper.sh b/Arma3Helper.sh index ae14575..321d77f 100755 --- a/Arma3Helper.sh +++ b/Arma3Helper.sh @@ -14,7 +14,7 @@ _SCRIPTVER="1v18-6" ## MAKE SURE YOU CHOOSE THE SAME PROTON VERSION AS FOR ARMA IN STEAM!!! # Set this to the Proton Version you are using with Arma! -# Available versions: "8.0 7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" +# Available versions: "8.0", "7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" # Defaults to: 8.0 PROTON_OFFICIAL_VERSION="" diff --git a/config b/config index 7d7bdf5..a121dad 100644 --- a/config +++ b/config @@ -1,24 +1,25 @@ #!/usr/bin/env bash ##################################################################################### -## Arma3helper.sh CONFIG FILE (This will override settings made in Arma3Helper.sh) +## Adjust below or use the external config file ##################################################################################### ## MAKE SURE YOU CHOOSE THE SAME PROTON VERSION AS FOR ARMA IN STEAM!!! # Set this to the Proton Version you are using with Arma! -# Available versions: "7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" -# Defaults to: 7.0 +# Available versions: "8.0", "7.0", "6.3", "5.13", "5.0", "4.11", "4.2", "3.16", "3.7", "Proton Experimental", "Experimental" +# Defaults to: 8.0 PROTON_OFFICIAL_VERSION="" ## Path to Arma's compatdata (wineprefix) -# Leave empty if Arma is installed in Steams default directory +# Leave empty if Arma is installed in Steams default library COMPAT_DATA_PATH="" # If you have proton in a different steam library, then put the path to its steamapps folder here -# Leave empty +# Leave empty if Proton is installed in Steams default library STEAM_LIBRARY_PATH="" # If you are using a custom proton build, then put its folder name (from inside compatibilitytools.d) here +# Leave empty if proton PROTON_CUSTOM_VERSION="" ## Esync/Fsync