Skip to content

Commit

Permalink
switching to bitsadmin if curl failed
Browse files Browse the repository at this point in the history
  • Loading branch information
livingflore committed Aug 1, 2023
1 parent 567177e commit 22a94bf
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 41 deletions.
97 changes: 57 additions & 40 deletions BattleBitEACFix.bat
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,52 @@ cls
SET GamePath=
FOR /F "tokens=2* skip=2" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 671860" /v "InstallLocation"') do SET GamePath="%%b"
:: echo %GamePath%
echo Closing EAC and BattleBit...
echo [...] Closing EAC and BattleBit
taskkill /f /im BattleBit.exe 2>nul 1>nul
taskkill /f /im BattleBitEAC.exe 2>nul 1>nul
taskkill /f /im EasyAntiCheat.exe 2>nul 1>nul
taskkill /f /im EasyAntiCheat_EOS_Setup.exe 2>nul 1>nul
taskkill /f /im UnityCrashHandler64.exe 2>nul 1>nul

echo Removing EAC Service...
echo [...] Removing EAC Service
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe uninstall 43ed9a4620fa486994c0b368cce73b5d
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe qa-factory-reset
sc delete EasyAntiCheat_EOS 2>nul 1>nul
sc delete EasyAntiCheat 2>nul 1>nul

echo Removing EAC folders...
echo [...] Removing EAC folders
rmdir /q /s "C:\Program Files (x86)\EasyAntiCheat_EOS" 2>nul 1>nul
rmdir /s /q "%temp%/../../Roaming/EasyAntiCheat" 2>nul 1>nul
rmdir /s /q "%temp%/../../Roaming/EasyAntiCheat" 2>nul 1>nul
rmdir /s /q "%temp%/../../LocalLow/BattleBitDevTeam" 2>nul 1>nul

Echo Removing EAC registry entries...
Echo [...] Removing EAC registry entries
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\EasyAntiCheat_EOS" /f 2>nul 1>nul
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\EasyAntiCheat" /f 2>nul 1>nul

echo Installing EAC...
echo [...] Installing EAC
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe install 43ed9a4620fa486994c0b368cce73b5d

echo Switching EAC service mode to automatic...
echo [...] Switching EAC service mode to automatic
sc config EasyAntiCheat_EOS start=Auto 2>nul 1>nul

echo Adding EAC ^& BattleBit Folder to Windows Defender exclusions...
echo [...] Adding EAC ^& BattleBit Folder to Windows Defender exclusions
powershell -Command Add-MpPreference -ExclusionPath %GamePath% > nul
powershell -Command Add-MpPreference -ExclusionPath 'C:\Program Files (x86)\EasyAntiCheat' > nul
powershell -Command Add-MpPreference -ExclusionPath 'C:\Program Files (x86)\EasyAntiCheat_EOS' > nul

echo Adding EAC ^& BattleBit executables to Defender Firewall exclusions...
echo [...] Adding EAC ^& BattleBit executables to Defender Firewall exclusions
powershell -Command New-NetFirewallRule -Program '%GamePath%\BattleBit.exe' -Action Allow -Profile Domain, Private -DisplayName 'Allow BattleBit' -Direction Outbound > nul
powershell -Command New-NetFirewallRule -Program '%GamePath%\EasyAntiCheat.exe' -Action Allow -Profile Domain, Private -DisplayName 'Allow BattleBit EAC' -Direction Outbound > nul
powershell -Command New-NetFirewallRule -Program 'C:\Program Files (x86)\EasyAntiCheat_EOS\EasyAntiCheat_EOS.exe' -Action Allow -Profile Domain, Private -DisplayName 'Allow EAC_EOS' -Direction Outbound > nul

echo.
echo EAC reinstall completed.
echo [+] EAC reinstall completed.
echo.

echo Flushing DNS...
echo [...] Flushing DNS
ipconfig /flushdns 2>nul 1>nul
echo Testing EAC Connection...
echo [...] Testing EAC Connection
echo download.eac-cdn.com:
curl download.eac-cdn.com --max-time 10
echo.
Expand All @@ -98,47 +98,64 @@ curl download-alt.easyanticheat.net --max-time 10
echo.

echo.
echo Installing VCRedist 2015-2022 x86-64
echo [...] Installing VCRedist 2015-2022 x86-64
echo.

echo Downloading VC_redist.x64...
echo [...] Downloading VC_redist.x64
curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe --output %temp%"VC_redist.x64.exe" --write-out "%errorlevel%" --progress-bar 1>nul
if %errorlevel% EQU 00 (
echo Installing VC_redist.x64.exe ^(might take a bit^)...
%temp%VC_redist.x64.exe /install /quiet /norestart
if ERRORLEVEL 0 (
echo VC_redist.x64.exe installed successfully!
) else (
echo VC_redist.x64.exe install failed with code: %ERRORLEVEL%
)
del %temp%VC_redist.x64.exe
goto install64
) else (
echo VC_redist.x64 - download failed ^:^(
echo [?] Unable to use curl, switching to bitsadmin instead...
bitsadmin.exe /transfer "VC_redist.x64" /download /priority FOREGROUND "https://aka.ms/vs/17/release/vc_redist.x64.exe" %temp%VC_redist.x64.exe 1>nul
if ERRORLEVEL 0 goto install64
echo [!] VC_redist.x64 - download failed ^:^(
echo [!] Please, download and install VC_redist.x64.exe manually - https://aka.ms/vs/17/release/vc_redist.x64.exe
goto endinstall64
)

:install64
echo [...] Installing VC_redist.x64.exe ^(might take a bit^)
%temp%VC_redist.x64.exe /install /quiet /norestart
if ERRORLEVEL 0 (
echo [+] VC_redist.x64.exe installed successfully!
) else (
echo [!] VC_redist.x64.exe install failed with code: %ERRORLEVEL%
echo [!] Please, download and install VC_redist.x64.exe manually - https://aka.ms/vs/17/release/vc_redist.x64.exe
)
del %temp%VC_redist.x64.exe
:endinstall64
echo.
echo Downloading VC_redist.x86...

echo [...] Downloading VC_redist.x86
curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe --output %temp%"VC_redist.x86.exe" --write-out "%errorlevel%" --progress-bar 1>nul
if %errorlevel% EQU 00 (
echo Installing VC_redist.x86.exe ^(might take a bit^)...
%temp%VC_redist.x86.exe /install /quiet /norestart
if ERRORLEVEL 0 (
echo VC_redist.x86.exe installed successfully!
) else (
echo VC_redist.x86.exe install failed with code: %ERRORLEVEL%
)
del %temp%VC_redist.x86.exe
if %errorlevel% EQU 00 (
goto install86
) else (
echo VC_redist.x86.exe - download failed ^:^(
echo [?] Unable to use curl, switching to bitsadmin instead...
bitsadmin.exe /transfer "VC_redist.x86" /download /priority FOREGROUND "https://aka.ms/vs/17/release/vc_redist.x86.exe" %temp%VC_redist.x86.exe 1>nul
if ERRORLEVEL 0 goto install86
echo [!] VC_redist.x86 - download failed ^:^(
echo [!] Please, download and install VC_redist.x86.exe manually - https://aka.ms/vs/17/release/vc_redist.x86.exe
goto endinstall86
)

:install86
echo [...] Installing VC_redist.x86.exe ^(might take a bit^)
%temp%VC_redist.x86.exe /install /quiet /norestart
if ERRORLEVEL 0 (
echo [+] VC_redist.x86.exe installed successfully!
) else (
echo [!] VC_redist.x86.exe install failed with code: %ERRORLEVEL%
echo [!] Please, download and install VC_redist.x86.exe manually - https://aka.ms/vs/17/release/vc_redist.x86.exe
)
del %temp%VC_redist.x86.exe
:endinstall86
echo.
echo Finished!
echo [+] Finished!
echo.
echo =================================================================================
echo NOTICE: If there's any errors above, screenshot them and send to #anti-cheat-help.
echo You might also need to select "Install & Repair Easy Anti Cheat" launch option
echo before actually launching the game.
echo NOTICE: If there's any errors above, screenshot them and send to #general-help.
echo You might also need to run "Install & Repair Easy Anti Cheat" launch option
echo before running BattleBit itself.
echo =================================================================================
echo.
CHOICE /C YN /M "Do you want to reboot your PC (recommended)"
Expand All @@ -147,7 +164,7 @@ IF %ERRORLEVEL% EQU 1 (
shutdown /s /f /t 0
) ELSE IF %ERRORLEVEL% EQU 2 (
echo.
echo Rebooting your PC is highly recommended, do it before opening BattleBit.
echo [!] Rebooting your PC is highly recommended, do it before opening BattleBit.
)

echo.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h1 align="center">
BattleBit EAC Fix</h1>

[![Download batch](https://custom-icon-badges.herokuapp.com/badge/-Download-black?style=for-the-badge&logo=download&logoColor=white)](https://livingflore.me/eacfix)
[![Download batch](https://custom-icon-badges.herokuapp.com/badge/-Download-black?style=for-the-badge&logo=download&logoColor=white)](https://github.com/livingflore/BattleBitEACFix/releases)
[![Discord](https://custom-icon-badges.herokuapp.com/badge/-Discord-black?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/battlebit)
[![Docs](https://custom-icon-badges.herokuapp.com/badge/-Docs-black?style=for-the-badge&logo=repo&logoColor=white)](https://docs.joinbattlebit.com/)

Expand Down

0 comments on commit 22a94bf

Please sign in to comment.