cleaner bnet

This commit is contained in:
Roy 2024-05-09 13:47:42 -07:00 committed by GitHub
parent 5207790fc0
commit 897ae4653b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1903,23 +1903,17 @@ if [[ $options == *"Battle.net"* ]]; then
echo "Running BATTLE file using Proton with the /passive option" 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" "$STEAM_RUNTIME" "$proton_dir/proton" run "$battle_file" Battle.net-Setup.exe --lang=enUS --installpath="C:\Program Files (x86)\Battle.net"
# Wait for the process to finish or timeout after a certain number of attempts
max_attempts=20
attempt=0
while true; do while true; do
if pgrep -f "Battle.net.exe" || pgrep -f "BlizzardError.exe" > /dev/null; then if pgrep -f "Battle.net.exe" || pgrep -f "BlizzardError.exe" > /dev/null; then
pkill -f "Battle.net.exe" || pkill -f "BlizzardError.exe" pkill -f "Battle.net.exe" || pkill -f "BlizzardError.exe"
break break
fi fi
sleep 1 sleep 1
((attempt++))
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Timeout: Battle.net process did not terminate."
break
fi
done done
# Wait for the bnet file to finish running
wait
fi fi
wait
# wait for Google Chrome to finish # wait for Google Chrome to finish
wait wait