If you’re fighting with deploying Unreal Engine 4, or just curious how we went about it, welcome aboard!

So Unreal Engine 4 is great, and the launcher is an awesome way for users to install and keep the engine up to date, but it’s a pain for sysadmins to deploy. Over the years at Staffordshire University I’ve trialled many different ways of running Unreal Engine with our students – from manually updating each machine, to binary builds which the students need to download a copy of.

What we’ve settled on is a halfway house, and a bit of a hack. If you want a TLDR – we take a copy of the launcher build, copy it to over 400 lab machines and then trick the launcher into thinking it’s one of it’s own builds. This gives the native launcher build experience but without the manual updates and engine conflicts!

Disclaimers first – this may completely stop working at any point in the future, but more likely than not we’ve had to find a work around, so if you’re in a school, college or university and need a hand, just send me a message on the contact page!

Down to it!

We found the easiest way for students to learn UE4 was to keep them locked on a single engine version. Luckily for us, we know Epic’s release cycle – Once a minor version is released as non-alpha (e.g. 4.20.1) then the previous version will no-longer receive updates (e.g. 4.19.4). This is great for us as the students can download it easily at home using the standard launcher, and we don’t need to host files for them, and neither of us will ever need to update. Cool!

So what happens in the labs? We build our lab PC images between May and August, with teaching starting in September. The ideal scenario for us is to use the latest possible “stable” (non-updating) build of the engine, which means deploying at the last moment – just after the image has been deployed in the labs.

The deployment can be broken down into a few parts:

  1. Download the engine build needed from the launcher
  2. Zip up the build files
  3. Create the version config file (explained later)
  4. Create a desktop shortcut
  5. Update the deployment batch script with current version numbers
  6. Test Deploy though SCCM or by hand if needed

Step 1 – Grab the Example files

Before we go though creating a deployment of your own build, have a quick look through the example files attached. You may need to change some parts for your own policies, such as firewall rule installations, and the user group granted write permissions. The main script is the Deploy_UnrealEngine_4.20.3.cmd which uses the other files in common and UE_4.20. Included is a copy of 7za, a command line version of 7zip used to extract the engine on the target machine.

All these files should be put on a shared storage server – we have these on an open-read network share so if a computer’s build goes “wonky” then any user can re-copy whatever they need and fix it. Bare minimum is permissions for your deployment system.

Step 2 – Download the Engine

So this is the easiest bit – Just run the normal launcher from our friends over at Epic and install the second to latest version – this one shouldn’t update anymore (at least it hasn’t yet!). For the sake of this guide I’ll be assuming the version we’re installing is 4.20.3

Pick the same location to install now as you want on the deployment as we’ll make a shortcut to it later. We use the C:\Epic\ directory as it allows separate permissions than the Program Files directory.

This will take a little while to install. Feel free to read ahead or, well, procrastinate.

Step 3 – Add Your Engine Plugins

If we want the users to have access to any plugins, such as the substance plugin, now is the time to install it. This is done just as normal, though the launcher and added to our newly downloaded engine build.

Step 4 – Zip up the Engine

We want to zip up the engine files, as copying the tens of thousands (literally) of small files will take forever over the network. Your SAN will thank you.

What we’ve found is using 7Zip to split to 700MB is a nice balance between number of files, and time lost when inevitably the copy fails and has to restart. Using a single 20GB zip file failed on around half the machines during early versions. No fun!

If you don’t already have 7zip, you can download it at 7-zip.org

Lets zip up the UE4.20 directory in C:\Epic\. The easiest way to do this and to keep the file structure correct inside the zip is to right click the UE4.XX folder and “add to archive”.

The following settings work well:

Copy these on a shared storage server – we have these on an open-read network share so if a computer’s build goes “wonky” then any user can re-download it and fix it easily.

Step 5 – Create The Version Files

So this is where the magic happens! The Launcher gets details of what it has installed from the LauncherInstalled.dat file in C:\ProgramData\Epic\UnrealEngineLauncher this is a json file which contains an entry for each installed engine, game, plugin etc.

The one for 4.20.3 with the substance plugin looks like this:

{
	"InstallationList": [
		{
			"InstallLocation": "C:\\Epic\\UE4\\UE_4.20",
			"AppName": "Substance_4.20",
			"AppID": 0,
			"AppVersion": "4.20.0-4234380+++depot+UE4-UserContent-Windows"
		},
		{
			"InstallLocation": "C:\\Epic\\UE4\\UE_4.20",
			"AppName": "UE_4.20",
			"AppID": 20040003,
			"AppVersion": "4.20.3-4369336+++UE4+Release-4.20-Windows"
		},
	]
}

What we want to do is extract the installation data for the engine version we want, and then rebuild this file on each machine, depending on what is actually installed to it.

For now, this boils down to just extracting the middle section for the engine we’re using and saving it out alongside our zip of the engine build, titled UE_4.21.dat. Make sure to keep the “,” after the final curly brace and the indentations.

		{
			"InstallLocation": "C:\\Epic\\UE4\\UE_4.20",
			"AppName": "Substance_4.20",
			"AppID": 0,
			"AppVersion": "4.20.0-4234380+++depot+UE4-UserContent-Windows"
		},
		{
			"InstallLocation": "C:\\Epic\\UE4\\UE_4.20",
			"AppName": "UE_4.20",
			"AppID": 20040003,
			"AppVersion": "4.20.3-4369336+++UE4+Release-4.20-Windows"
		},

What happens in the installation script is it wraps a header and footer around each of the engine, plugin and game .dats we’re creating and rebuilds it on any new deployments. Note that you must use the exact information from the dat created by the launcher when you downloaded and zipped your version. The example files may differ in minor version numbers!

The deployument script will flag the newly created Launcherinstalled.dat file as read-only to stop the Launcher from overwriting the installation as “it” didn’t create it. This is the hack I alluded to earlier.

Step 6 – Create a Desktop Shortcut

One of the drawbacks for using this method is you’re not able to run the engine from the launcher anymore. One of the ways we simplify this is to add a shortcut to the desktop and start menu for launching the engine.

Sadly in windows, there’s no simple way to automate the generation of shortcuts for a file without third party programs, so for simplicity, we just make one now. This is the importance of having the launcher install to the desired final location – we can’t create a shortcut to a location that doesn’t exist yet. Once this is made, copy it alongside the other deployment files.

Step 7 – Update the Batch Deployment Scripts

In all likelihood you’ll be using a newer build than the one described in this guide, so change the major and minor version in the Deploy_UnrealEngine_4.20.3.cmd batch script to match the engine build you’re deploying, and rename it. The script references the version from the top of the script, so it’s easy to update as needed. Also included here are options to change the network share directory, install location (make sure your shortcut matches!) and shortcut location.

Step 8 – Test Deployment!

So we should be ready! We have our build files and now we can do a test deployment. The script will work fine ran locally when elevated (check your share permissions if you hit issues). It will copy the files to a temporary location, extract them, install the engine specific pre-requisites for x86 and x64, add firewall rules, copy the shortcuts and finally delete the temporary zip files.

And That’s that!

If this has been useful to you, or you’re stuck and need a hand, please do give me a shout on the contact form!

If anyone at Epic reads this, PLEASE, give us a command line flag for the launcher to update builds, this would make literally anyone teaching games in education so happy!

Rich Harper

Rich Harper

I’m a Creative Technologist. I build, create, hack, reverse-engineer, design and develop pretty much anything related to visual media.

Leave a Reply