UE5 Clone Setup Script | Auto Patch, Compile & Launch

Introduction

Working with middleware integrations such as Wwise and FMOD has made me acutely aware of the challenges they pose in regards to version control and multi-disciplinary team work. Having to patch plugin files correctly into a repository clone can prove challenging for people with little knowledge of plugin integration, let alone using Visual Studio to build the project for source.

My solution to this was to create an “Auto-launch” batch file that patches, compiles and launches a fresh clone of an Unreal Engine project. This allows artists, designers, etc. to easily launch the project from a new machine.

Although convenient, it comes with some caveats. Firstly, the script requires 7Zip for plugin extraction and secondly the paths to the UnrealBuildTool and UnrealVersionSelector will be specific to each machines installation. These variables can all be tweaked in the batch file however, and at somewhere like my University, all machine installations are identical.

The scripts for this setup can be seen below:

Configuration / Compiling Script

This script I name “DontTouch.cmd” as it shouldn’t be run or modified by an end user, this is where the majority of customisation for your system should be.

echo off

rem Getting parent folder
FOR %%A IN ("%~dp0.") DO SET ParentDIR=%%~dpA

del %ParentDIR%\*.sln
rmdir /s /q %ParentDIR%\.vs
rmdir /s /q %ParentDIR%\Binaries
rmdir /s /q %ParentDIR%\Intermediate
rem rmdir /s /q %ParentDIR%\Saved
rmdir /s /q %ParentDIR%\DerivedDataCache


set UVS="C:\Program Files (x86)\Epic Games\Launcher\Engine\Binaries\Win64\UnrealVersionSelector.exe"
set UBT="C:\Program Files\Epic Games\UE_5.1\Engine\Binaries\DotNET\UnrealBuildTool\UnrealBuildTool.exe"

set FullPath="%ParentDIR%\[Project Name]"

%UVS% /projectfiles %FullPath%.uproject

%UBT% Development Win64 -Project=%FullPath%.uproject -TargetType=Editor -Progress -NoEngineChanges -NoHotReloadFromIDE

%FullPath%.uproject

pause

Launch Script

This script I name “LaunchProject” and is the one a user will run to patch and compile a project procedurally.

echo off

rem Unzipping plugins folder
"C:\Program Files\7-Zip\7z.exe" x Plugins.zip

rem Getting parent folder
FOR %%A IN ("%~dp0.") DO SET ParentDIR=%%~dpA

xcopy /s /y Plugins %ParentDIR%\Plugins

@RD /S /Q Plugins

call DontTouch.cmd

These two files should be placed into a folder inside of your Unreal Project root (the same folder the .uproject file is inside) along with these two scripts should be a zipped folder named “Plugins” that contains the dependencies required for your project. An example hierarchy would be “\\Game\AutoSetup\Plugins.zip, DontTouch.cmd, LaunchProject.cmd“. and inside of the zip “Plugins.zip\Plugins\Wwise“. Once this is all setup it should be a much easier process setting up a clone on a new machine.