Skip to content

Commit

Permalink
cleaner bnet
Browse files Browse the repository at this point in the history
  • Loading branch information
moraroy committed May 9, 2024
1 parent 5207790 commit 897ae46
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions NonSteamLaunchers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1903,23 +1903,17 @@ if [[ $options == *"Battle.net"* ]]; then
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"

# Wait for the process to finish or timeout after a certain number of attempts
max_attempts=20
attempt=0
while true; do
if pgrep -f "Battle.net.exe" || pgrep -f "BlizzardError.exe" > /dev/null; then
pkill -f "Battle.net.exe" || pkill -f "BlizzardError.exe"
break
fi
sleep 1
((attempt++))
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Timeout: Battle.net process did not terminate."
break
fi
done

# Wait for the bnet file to finish running
wait
fi
wait

# wait for Google Chrome to finish
wait
Expand Down

0 comments on commit 897ae46

Please sign in to comment.