Inifinite loop when launching via batch file with EAC installed

I have a game on Epic Games Launcher that players have complained about issues of not being able to launch because of missing prerequisites. Because we have our -PrereqPath in our BuildPatchTool Upload command already set to the Easy Anti Cheat installer (-PrereqPath=“EasyAntiCheat\EasyAntiCheat_EOS_Setup.exe”), I have decided to go about the Batch file method of launching the game as suggested in the Epic documentation (Under Batch Script: https://dev.epicgames.com/docs/epic-games-store/services/game-prereqs-installer?sessionInvalidated=true).

My batch file checks if the player has Unreal Engine Prerequisites installed (looking up by registry key). If not, it will run the UEPrerequisites installer. Then it will launch start_protected_game.exe, our EAC protected application. Previously, we had the -AppLaunch= in the BuildPatchTool set to start_protected_game.exe (our EAC protected app), which launched without issues given the player has prerequisites installed and what is currently the live retail setting. After incorporating the batch file into the build, I have set the -AppLaunch= to the **BATCH FILE NAME**. After submitting the build to my test branch, I have tested this on multiple machines. Launching the app through the Epic Games Launcher will launch the batch file, and the batch correctly confirms whether UEPrerequisites are installed, and will launch the UEPrereq installer if not, prompting player to go through the installation. After installation, or if player already has UEPrereqs installed, the batch file will then show that it is attempting to launch start_protected_game.exe.

This is where we get caught in an endless loop. EAC splash screen appears. Then our game splash screen briefly appears before disappearing. The Epic Game Launcher window appears, then the batch file console window appears again confirming that prereqs are installed and that game is launching, EAC splash screen will display again briefly, followed by the game splash screen, then Epic Games Launcher window will appear and the loop repeats, never fully launching the game. The user has to force quit the Epic Games Launcher. Video attached.

I tried isolating the issue by launching just by double clicking the start_protected_game.exe directly, bypassing the batch file, which previously would launch the game fine before the incorporation of the batch file. But now, even just trying to launch that directly will cause the loop, with the EAC splash screen, then game splash screen, then Epic Games Launcher splash screen. Then the batch file will appear to launch on the next loop and then the loop continues. So that makes me think that EAC is calling Epic Games to launch through its -AppLaunch= as defined in the BuildPatchTool command. I am a little stumped now as to how to go about this or if you have any ideas on easier way to allow players to auto install prereqs on game install alongside the EAC initial install.

My batch file:

@echo off
setlocal enabledelayedexpansion
 
rem Get the directory where this batch file is located
set "SCRIPT_DIR=%~dp0"
set "PREREQ_PATH=%SCRIPT_DIR%Engine\Extras\Redist\en-us\UEPrereqSetup_x64.exe"
set "GAME_EXE=%SCRIPT_DIR%start_protected_game.exe"
 
echo Checking if Unreal Engine 5 prerequisites are installed (required to launch the game)
echo Prereq installer: %PREREQ_PATH%
rem Check if UE prerequisites are installed by looking for a registry key
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{9F18D9CE-84C9-4AEA-9421-38FD2AC30B77}" >nul 2>&1
if %ERRORLEVEL% EQU 0 (
    echo Unreal Engine 5 Prerequisites are already installed.
) else (
    echo Missing Unreal Engine 5 Prerequisites. Launching Unreal Engine 5 prerequisite installer. Please follow prompts on the installer to continue..
    start /wait "" "%PREREQ_PATH%"
)
 
rem Launch the game and WAIT for it to finish
if exist "%GAME_EXE%" (
    echo Launching game from %GAME_EXE%...
    start /wait "" "%GAME_EXE%"
) else (
    echo Error: Game executable not found at %GAME_EXE%
    pause
    exit /b 1
)
 
endlocal
exit /b 0

[Image Removed]

[Attachment Removed]

Hello! Could you please check to see if you’re using any mechanisms to enforce that your game was launched via the Epic Games Launcher?

This might involve the EOS SDK API EOS_Platform_CheckForLauncherAndRestart, or a simple launch argument check for “-EpicPortal”.

It doesn’t look like your batch script is forwarding on the launch arguments that the Epic Games Launcher provides to your game.

Along with this launcher check, these arguments are used to provide seamless authentication within your game and also provide environment IDs.

If you don’t see any such checks, to further troubleshoot, I would recommend the following steps:

1. Move the UE Prerequisite installation steps to a batch file on game installation that also includes the anti-cheat service installation.

This simply reduces the complexity around game launch and should make further troubleshooting easier.

2. Forward the launch arguments to the game executable.

3. Share logs from the Epic Games Launcher, with debug logging enabled.

https://www.epicgames.com/help/en\-US/epic\-games\-store\-c\-202300000001639/launcher\-support\-c\-202300000001735/how\-do\-i\-gather\-logs\-for\-epic\-games\-launcher\-a202300000015909

[Attachment Removed]