|
| 1 | + |
| 2 | +@echo off |
| 3 | + |
| 4 | +if "%UEBatchScriptEnvLoaded%"=="true" ( |
| 5 | + exit /B 0 |
| 6 | +) |
| 7 | +set UEBatchScriptEnvLoaded=true |
| 8 | + |
| 9 | +set PluginScriptDir=%~dp0 |
| 10 | +cd ..\..\.. |
| 11 | + |
| 12 | +for /F "tokens=4 delims= " %%i in ('route print ^| find " 0.0.0.0"') do set LocalIP=%%i |
| 13 | + |
| 14 | +for %%f in (*.uproject) do ( |
| 15 | + set ProjectPath="%cd%\%%f" |
| 16 | + for /F "eol=, tokens=1,2*" %%i in (%%f) do ( |
| 17 | + if %%i==^"EngineAssociation^"^: ( |
| 18 | + if %%j==^"4.27^"^, ( |
| 19 | + set UEVersion=4.27 |
| 20 | + set UEEnginePath=%UE427EnginePath% |
| 21 | + ) |
| 22 | + if %%j==^"5.0^"^, ( |
| 23 | + set UEVersion=5.0 |
| 24 | + set UEEnginePath=%UE50EnginePath% |
| 25 | + ) |
| 26 | + if %%j==^"5.1^"^, ( |
| 27 | + set UEVersion=5.1 |
| 28 | + set UEEnginePath=%UE51EnginePath% |
| 29 | + ) |
| 30 | + if %%j==^"5.2^"^, ( |
| 31 | + set UEVersion=5.2 |
| 32 | + set UEEnginePath=%UE52EnginePath% |
| 33 | + ) |
| 34 | + if %%j==^"5.3^"^, ( |
| 35 | + set UEVersion=5.3 |
| 36 | + set UEEnginePath=%UE53EnginePath% |
| 37 | + ) |
| 38 | + if %%j==^"5.4^"^, ( |
| 39 | + set UEVersion=5.4 |
| 40 | + set UEEnginePath=%UE54EnginePath% |
| 41 | + ) |
| 42 | + if %%j==^"5.5^"^, ( |
| 43 | + set UEVersion=5.5 |
| 44 | + set UEEnginePath=%UE55EnginePath% |
| 45 | + ) |
| 46 | + ) |
| 47 | + ) |
| 48 | +) |
| 49 | + |
| 50 | +if "%UEEnginePath%"=="" ( |
| 51 | + echo ERROR: Could not find Unreal Engine v%UEVersion% for project %ProjectPath%, please add your Unreal engine paths to your system environment variables in the format UE52EnginePath=C:\path\to\Unreal_5.2\Engine . |
| 52 | + exit 0 |
| 53 | +) |
| 54 | + |
| 55 | +set RunUAT="%UEEnginePath%\Build\BatchFiles\RunUAT.bat" |
| 56 | + |
| 57 | +if %UEVersion%==4.27 ( |
| 58 | + set UEEditor="%UEEnginePath%\Binaries\Win64\UE4Editor.exe" |
| 59 | + set UEEditorCmd="%UEEnginePath%\Binaries\Win64\UE4Editor-Cmd.exe" |
| 60 | +) else ( |
| 61 | + set UEEditor="%UEEnginePath%\Binaries\Win64\UnrealEditor.exe" |
| 62 | + set UEEditorCmd="%UEEnginePath%\Binaries\Win64\UnrealEditor-Cmd.exe" |
| 63 | +) |
| 64 | + |
| 65 | +:: TODO: set these up for the plugin |
| 66 | +set UnitTestMap=/Game/Maps/AutomatedTestMap |
| 67 | +set MainMenuMap=/Game/Maps/MainMenuMap |
| 68 | +set MainGameMap=/Game/Maps/PlayMap |
| 69 | +set AllMaps=%UnitTestMap%+%MainMenuMap%+%MainGameMap% |
| 70 | + |
| 71 | +echo Running on %COMPUTERNAME% |
| 72 | +echo UEVersion: %UEVersion% |
| 73 | +echo UEEnginePath: %UEEnginePath% |
| 74 | +echo UEEditor: %UEEditor% |
| 75 | +echo RunUAT: %RunUAT% |
| 76 | +echo ProjectPath: %ProjectPath% |
| 77 | +echo. |
| 78 | + |
| 79 | +cd %PluginScriptDir% |
0 commit comments