Packaging UE4 for distributing internally

I understand this question has been asked before but many posts I see have either outdated information, or incomplete, I haven’t been able to find a solid answer.

We have a custom build of UE4 that includes our own plugin and some small modifications to the runtime code. We want to have the ability to distribute this build internally but keep the size of the distribution as close to what you would get from the Epic Games launcher as possible. We have to assume this build will not be used by users that are familiar with Git or Visual Studio, so pulling down and compiling is not an option for those users.

Is there a way to package this in the same way, or as close to the same way as the distro for the Epic Games launcher?

Here’s my current process I’ve setup on our build server:

  1. Get dependencies using Setup.bat
  2. Run GenerateProjectFiles.bat
  3. Compile Development Editor configuration
  4. Compile Development Configuration
  5. Compile Shipping Configuration
  6. Zip all files excluding anything in Engine/Source, Engine/Intermediate, the Visual Studio .sdf & .opensdf files & any .pdb files in all folders
  7. Re-add Engine/Binaries/Win64/UE4Game.pdb back to the zip file because the Editor complains it’s missing for launch standalone game I believe(?)

That gets me pretty close I think but I can’t rule out that I’m still missing something else, or there is something else different about the build I just don’t know about.

Thanks!

To add to this, there are some issues with my process since when I go to add C++ classes to the project I create using the distribution I created above I get errors about missing files in Engine/Source/.

I checked the Epic Games launcher source folder and it’s about 898MB, while if I included the GitHub version it’s over 6GB which is the reason I understandable want to trim it if I’m distributing internally.

We use the Automation Tool to make the builds we release with the Launcher and recommend that as the most fool proof way of distributing engine builds internally.

After running Setup.bat, if you open a command prompt in Engine/Build/BatchFiles and run:

RunUAT.bat GUBP -Node=GatherRocket -TargetPlatforms=Win32+Win64 -NoDDC -CleanLocal -NoSign

That should eventually create a Launcher like build in LocalBuilds/Rocket/Windows. As this is specifically for creating our Launcher build, this will also include FeaturePacks, Samples and Templates, which you probably don’t want to distribute. If you want to modify how this build works for your specific situation, you’ll find the C# scripts that control it in: Engine/Source/Programs/AutomationTool/Scripts/RocketBuild.Automation.cs, for example around line 820 you’ll see a dependency on MakeFeaturePacksNode being added, which could be removed to prevent the inclusion of these.

Hope that helps, let me know if you have any difficulties/questions about this system.

Appreciate the info, I was mostly successful…

I had an error because it couldn’t find PDBCopy. I edited the line referencing it in VCToolChain.cs and changing it to point to the VS2015 version of PDBCopy instead of the VS2013 version since I did not have it installed. That fixed that.

Second error was:
GUBP.ExecuteNode: AutomationTool.AutomationException: Cannot find project ‘FP_FirstPerson’ in branch
at AutomationTool.BranchInfo.FindGameChecked(String GameName) in C:\engine4-11\UnrealEngine\Engine\Source\Programs\AutomationTool\AutomationUtils\ProjectUtils.cs:line 808
at Rocket.FilterRocketNode.DoBuild(GUBP bp) in c:\engine4-11\UnrealEngine\Engine\Source\Programs\AutomationTool\Scripts\RocketBuild.Automation.cs:line 901
at AutomationTool.LegacyNode.DoBuild() in c:\engine4-11\UnrealEngine\Engine\Source\Programs\AutomationTool\GUBP\Nodes\LegacyNode.cs:line 79
at GUBP.ExecuteNode(BuildNode NodeToDo, Boolean bFake) in c:\engine4-11\UnrealEngine\Engine\Source\Programs\AutomationTool\GUBP\GUBP.cs:line 1395
Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)
Domain_ProcessExit
AutomationToolLauncher exiting with ExitCode=1
copying UAT log files…
BUILD FAILED

After removing the items in the CurrentTemplates & CurrentFeaturePacks arrays in RocketBuild.automation.cs the error went away. But I’m curious as to why it couldn’t find them since I do want to distribute with them.

After that everything compiled successfully and I noticed I was left with just an Engine & Plugins folder however it was missing the other necessary files. I manually copied all the other folders in the Engine folder such Build,Config,Content,Documentation etc into my Saved/Rocket/Signed/Win64/Engine folder and it launches and everything works.

I’m wondering though is there something else I can run on the command line to automatically stage the rest of the files required for Windows for it to run after compilation?

Thanks again!

Thanks for the catch on the PDBCopy issue, we’re currently in the process of changing over to make 2013 not a requirement so wouldn’t want to leave it in that state, I’ll make sure 2015 is supported.

I’m not sure why FP_FirstPerson could not be found if the samples and templates folders exist, though I don’t know if it’s because we don’t distribute the FeaturePacks folder on Git, I’ll look into it. You could possibly try grabbing the FeaturePacks folder from a Launcher distribution of the engine, it’s probably an oversight.

As for missing files, as long as the node completes successfully then everything required should definitely be copied over. If it was still failing then it might not have got to the part where copying is done - or if the template and feature pack arrays are completely empty then maybe it skips over some important part of the process. There will definitely be some samples that aren’t included, which you won’t be able to build but the basic starter content and templates should work.

When I pull down the Git repo and after running Setup.bat I have the FeaturesPacks & Templates folders alongside the Engine folder, same as the Launcher version. Not sure why it can’t find it either.

Think I’ve found why the template projects aren’t being found, the UE4Games.uprojectdirs file in the root directory controls where UBT looks for additional .uproject files. This is set to only look in the root and Engine/Source by default in the GitHub distro, which is so that you don’t have the sample projects etc. showing up as actual projects in the UE4.sln created by running GenerateProjectFiles.bat.

If you add:

Samples/
Templates/

to UE4Games.uprojectdirs on the build machine then it should be able to find all the sample projects that it needs. It won’t copy this to the LocalBuilds folder afterwards so it shouldn’t affect the build you want to distribute. Let me know if that works and resolves the file copying issue.

Worked beautifully and I see the output in LocalBuilds\Rocket\Windows now. Thanks for all the help!

No problem, glad we could figure it out for other users too.

Hey, I found this thread while trying to build engine source for my team, and tried using the RunUAT command listed above (although I left Win32 out and only built Win64)

I modified the CurrentTemplates and CurrentFeaturePacks in RocketBuild.Automation.cs to be empty in order to get it to build.

Once I had the build transferred from my build machine to my main PC I tried to use UnrealVersionSelector to set this as the active engine build, but ran into two issues:

  1. The Win64 version of the tool doesn’t exist, but the Win32 version does.
  2. If I try and use the Win32 version, I get the error “UnrealBuildTool Exception: ERROR: GetBuildPlatform: No BuildPlatform found for Win64”

Any clue what I may have missed?

I’m not really familiar with UnrealVersionSelector but I don’t think it was intentional that this was distributed with the installed build, it’s best to use the version that comes with the Epic Games Launcher. You should be able to right click your .uproject file and set which version of the engine you want to use from there.

This answer does not work for recent versions of the engine. When running the command “RunUAT.bat GUBP -Node=…” with UE4.18 I get the following error: “Failed to find command GUBP”.
I found a solution here: Getting "Failed to find command GUBP" when running AutomationTool - Platform & Builds - Epic Developer Community Forums