woops reverted

This commit is contained in:
Roy 2023-06-05 11:25:44 -07:00 committed by GitHub
parent 8c1da149c7
commit 8188d59555
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1613,57 +1613,47 @@ if [[ $options == *"Battle.net"* ]]; then
# Check if Battlenet Launcher is installed # Check if Battlenet Launcher is installed
if [[ ! -f "$battlenet_path1" ]] && [[ ! -f "$battlenet_path2" ]]; then if [[ ! -f "$battlenet_path1" ]] && [[ ! -f "$battlenet_path2" ]]; then
# Set the appid for the Battlenet Launcher
if [ "$use_separate_appids" = true ]; then
appid=Battle.netLauncher
else
appid=NonSteamLaunchers
fi
# Create app id folder in compatdata folder if it doesn't exist
if [ ! -d "$HOME/.local/share/Steam/steamapps/compatdata/$appid" ]; then
mkdir -p "$HOME/.local/share/Steam/steamapps/compatdata/$appid"
fi
# Change working directory to Proton's # Set the appid for the Battlenet Launcher
cd $proton_dir if [ "$use_separate_appids" = true ]; then
appid=Battle.netLauncher
else
appid=NonSteamLaunchers
fi
# Set the STEAM_COMPAT_CLIENT_INSTALL_PATH environment variable # Create app id folder in compatdata folder if it doesn't exist
export STEAM_COMPAT_CLIENT_INSTALL_PATH="~/.local/share/Steam" if [ ! -d "$HOME/.local/share/Steam/steamapps/compatdata/$appid" ]; then
mkdir -p "$HOME/.local/share/Steam/steamapps/compatdata/$appid"
fi
# Set the STEAM_COMPAT_DATA_PATH environment variable for Epic Games Launcher # Change working directory to Proton's
export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata/$appid cd $proton_dir
# Download BATTLE file # Set the STEAM_COMPAT_CLIENT_INSTALL_PATH environment variable
if [ ! -f "$battle_file" ]; then export STEAM_COMPAT_CLIENT_INSTALL_PATH="~/.local/share/Steam"
echo "Downloading BATTLE file"
wget $battle_url -O $battle_file
fi
# Run the BATTLE file using Proton with the /passive option # Set the STEAM_COMPAT_DATA_PATH environment variable for Epic Games Launcher
echo "Running BATTLE file using Proton with the /passive option" export STEAM_COMPAT_DATA_PATH=~/.local/share/Steam/steamapps/compatdata/$appid
"$STEAM_RUNTIME" "$proton_dir/proton" run "$battle_file" Battle.net-Setup.exe --lang=enUS --installpath="C:\Program Files (x86)\Battle.net" &
# Add a counter variable to track the number of times the loop runs
counter=0
while true; do # Download BATTLE file
if pgrep -f "Battle.net.exe" > /dev/null; then if [ ! -f "$battle_file" ]; then
pkill -f "Battle.net.exe" echo "Downloading BATTLE file"
break wget $battle_url -O $battle_file
fi fi
# Increment the counter variable each time the loop runs # Run the BATTLE file using Proton with the /passive option
((counter++)) echo "Running BATTLE file using Proton with the /passive option"
"$STEAM_RUNTIME" "$proton_dir/proton" run "$battle_file" Battle.net-Setup.exe --lang=enUS --installpath="C:\Program Files (x86)\Battle.net" &
# Check if the counter has reached a certain value and exit the loop if it has while true; do
if [[ $counter -ge 60 ]]; then if pgrep -f "Battle.net.exe" > /dev/null; then
echo "Timeout: Battle.net.exe process not found after 60 seconds" pkill -f "Battle.net.exe"
break break
fi fi
sleep 1
sleep 1 done
done
fi fi
fi fi