Skip to content

Commit 22a94bf

Browse files
committed
switching to bitsadmin if curl failed
1 parent 567177e commit 22a94bf

2 files changed

Lines changed: 58 additions & 41 deletions

File tree

BattleBitEACFix.bat

Lines changed: 57 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -44,52 +44,52 @@ cls
4444
SET GamePath=
4545
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"
4646
:: echo %GamePath%
47-
echo Closing EAC and BattleBit...
47+
echo [...] Closing EAC and BattleBit
4848
taskkill /f /im BattleBit.exe 2>nul 1>nul
4949
taskkill /f /im BattleBitEAC.exe 2>nul 1>nul
5050
taskkill /f /im EasyAntiCheat.exe 2>nul 1>nul
5151
taskkill /f /im EasyAntiCheat_EOS_Setup.exe 2>nul 1>nul
5252
taskkill /f /im UnityCrashHandler64.exe 2>nul 1>nul
5353

54-
echo Removing EAC Service...
54+
echo [...] Removing EAC Service
5555
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe uninstall 43ed9a4620fa486994c0b368cce73b5d
5656
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe qa-factory-reset
5757
sc delete EasyAntiCheat_EOS 2>nul 1>nul
5858
sc delete EasyAntiCheat 2>nul 1>nul
5959

60-
echo Removing EAC folders...
60+
echo [...] Removing EAC folders
6161
rmdir /q /s "C:\Program Files (x86)\EasyAntiCheat_EOS" 2>nul 1>nul
6262
rmdir /s /q "%temp%/../../Roaming/EasyAntiCheat" 2>nul 1>nul
6363
rmdir /s /q "%temp%/../../Roaming/EasyAntiCheat" 2>nul 1>nul
6464
rmdir /s /q "%temp%/../../LocalLow/BattleBitDevTeam" 2>nul 1>nul
6565

66-
Echo Removing EAC registry entries...
66+
Echo [...] Removing EAC registry entries
6767
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\EasyAntiCheat_EOS" /f 2>nul 1>nul
6868
reg delete "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\EasyAntiCheat" /f 2>nul 1>nul
6969

70-
echo Installing EAC...
70+
echo [...] Installing EAC
7171
%GamePath%\EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe install 43ed9a4620fa486994c0b368cce73b5d
7272

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

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

81-
echo Adding EAC ^& BattleBit executables to Defender Firewall exclusions...
81+
echo [...] Adding EAC ^& BattleBit executables to Defender Firewall exclusions
8282
powershell -Command New-NetFirewallRule -Program '%GamePath%\BattleBit.exe' -Action Allow -Profile Domain, Private -DisplayName 'Allow BattleBit' -Direction Outbound > nul
8383
powershell -Command New-NetFirewallRule -Program '%GamePath%\EasyAntiCheat.exe' -Action Allow -Profile Domain, Private -DisplayName 'Allow BattleBit EAC' -Direction Outbound > nul
8484
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
8585

8686
echo.
87-
echo EAC reinstall completed.
87+
echo [+] EAC reinstall completed.
8888
echo.
8989

90-
echo Flushing DNS...
90+
echo [...] Flushing DNS
9191
ipconfig /flushdns 2>nul 1>nul
92-
echo Testing EAC Connection...
92+
echo [...] Testing EAC Connection
9393
echo download.eac-cdn.com:
9494
curl download.eac-cdn.com --max-time 10
9595
echo.
@@ -98,47 +98,64 @@ curl download-alt.easyanticheat.net --max-time 10
9898
echo.
9999

100100
echo.
101-
echo Installing VCRedist 2015-2022 x86-64
101+
echo [...] Installing VCRedist 2015-2022 x86-64
102102
echo.
103103

104-
echo Downloading VC_redist.x64...
104+
echo [...] Downloading VC_redist.x64
105105
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
106106
if %errorlevel% EQU 00 (
107-
echo Installing VC_redist.x64.exe ^(might take a bit^)...
108-
%temp%VC_redist.x64.exe /install /quiet /norestart
109-
if ERRORLEVEL 0 (
110-
echo VC_redist.x64.exe installed successfully!
111-
) else (
112-
echo VC_redist.x64.exe install failed with code: %ERRORLEVEL%
113-
)
114-
del %temp%VC_redist.x64.exe
107+
goto install64
115108
) else (
116-
echo VC_redist.x64 - download failed ^:^(
109+
echo [?] Unable to use curl, switching to bitsadmin instead...
110+
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
111+
if ERRORLEVEL 0 goto install64
112+
echo [!] VC_redist.x64 - download failed ^:^(
113+
echo [!] Please, download and install VC_redist.x64.exe manually - https://aka.ms/vs/17/release/vc_redist.x64.exe
114+
goto endinstall64
117115
)
118-
116+
:install64
117+
echo [...] Installing VC_redist.x64.exe ^(might take a bit^)
118+
%temp%VC_redist.x64.exe /install /quiet /norestart
119+
if ERRORLEVEL 0 (
120+
echo [+] VC_redist.x64.exe installed successfully!
121+
) else (
122+
echo [!] VC_redist.x64.exe install failed with code: %ERRORLEVEL%
123+
echo [!] Please, download and install VC_redist.x64.exe manually - https://aka.ms/vs/17/release/vc_redist.x64.exe
124+
)
125+
del %temp%VC_redist.x64.exe
126+
:endinstall64
119127
echo.
120-
echo Downloading VC_redist.x86...
128+
129+
echo [...] Downloading VC_redist.x86
121130
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
122-
if %errorlevel% EQU 00 (
123-
echo Installing VC_redist.x86.exe ^(might take a bit^)...
124-
%temp%VC_redist.x86.exe /install /quiet /norestart
125-
if ERRORLEVEL 0 (
126-
echo VC_redist.x86.exe installed successfully!
127-
) else (
128-
echo VC_redist.x86.exe install failed with code: %ERRORLEVEL%
129-
)
130-
del %temp%VC_redist.x86.exe
131+
if %errorlevel% EQU 00 (
132+
goto install86
131133
) else (
132-
echo VC_redist.x86.exe - download failed ^:^(
134+
echo [?] Unable to use curl, switching to bitsadmin instead...
135+
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
136+
if ERRORLEVEL 0 goto install86
137+
echo [!] VC_redist.x86 - download failed ^:^(
138+
echo [!] Please, download and install VC_redist.x86.exe manually - https://aka.ms/vs/17/release/vc_redist.x86.exe
139+
goto endinstall86
133140
)
134-
141+
:install86
142+
echo [...] Installing VC_redist.x86.exe ^(might take a bit^)
143+
%temp%VC_redist.x86.exe /install /quiet /norestart
144+
if ERRORLEVEL 0 (
145+
echo [+] VC_redist.x86.exe installed successfully!
146+
) else (
147+
echo [!] VC_redist.x86.exe install failed with code: %ERRORLEVEL%
148+
echo [!] Please, download and install VC_redist.x86.exe manually - https://aka.ms/vs/17/release/vc_redist.x86.exe
149+
)
150+
del %temp%VC_redist.x86.exe
151+
:endinstall86
135152
echo.
136-
echo Finished!
153+
echo [+] Finished!
137154
echo.
138155
echo =================================================================================
139-
echo NOTICE: If there's any errors above, screenshot them and send to #anti-cheat-help.
140-
echo You might also need to select "Install & Repair Easy Anti Cheat" launch option
141-
echo before actually launching the game.
156+
echo NOTICE: If there's any errors above, screenshot them and send to #general-help.
157+
echo You might also need to run "Install & Repair Easy Anti Cheat" launch option
158+
echo before running BattleBit itself.
142159
echo =================================================================================
143160
echo.
144161
CHOICE /C YN /M "Do you want to reboot your PC (recommended)"
@@ -147,7 +164,7 @@ IF %ERRORLEVEL% EQU 1 (
147164
shutdown /s /f /t 0
148165
) ELSE IF %ERRORLEVEL% EQU 2 (
149166
echo.
150-
echo Rebooting your PC is highly recommended, do it before opening BattleBit.
167+
echo [!] Rebooting your PC is highly recommended, do it before opening BattleBit.
151168
)
152169

153170
echo.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h1 align="center">
33
BattleBit EAC Fix</h1>
44

5-
[![Download batch](https://custom-icon-badges.herokuapp.com/badge/-Download-black?style=for-the-badge&logo=download&logoColor=white)](https://livingflore.me/eacfix)
5+
[![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)
66
[![Discord](https://custom-icon-badges.herokuapp.com/badge/-Discord-black?style=for-the-badge&logo=discord&logoColor=white)](https://discord.gg/battlebit)
77
[![Docs](https://custom-icon-badges.herokuapp.com/badge/-Docs-black?style=for-the-badge&logo=repo&logoColor=white)](https://docs.joinbattlebit.com/)
88

0 commit comments

Comments
 (0)