Proper way to add Server target to Installed Engine Build

I have been referencing this guide for how to add the server target to my installed build: How To: BuildGraph - Jack Knobel.

This was working for me up until I upgraded my engine from 4.17.2 to 4.20.2. Now, no matter what project I attempt to build the DevelopmentServer configuration with, I get the following error:


1>
1>------ Build started: Project: BattleRoyale, Configuration: Development_Server x64 ------
1>Performing full C++ include scan (building a new target)
1>Using 'git status' to determine working set for adaptive non-unity build.
1>Creating makefile for BattleRoyaleServer (no existing makefile)
1>UnrealBuildTool : error : Couldn't find target rules file for target 'UE4Server' in rules assembly 'UE4Rules, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
1> Location: D:\UE4Projects\installed-build\Windows\Engine\Intermediate\Build\BuildRules\UE4Rules.dll
1> Target rules found:
1>
1> (see ../Programs/UnrealBuildTool/Log.txt for full exception trace)
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets(44,5): error MSB3075: The command "D:\UE4Projects\installed-build\Windows\Engine\Build\BatchFiles\Build.bat BattleRoyaleServer Win64 Development "C:\Workspace\src\github.com\shaunrandall\battle_royale\BattleRoyale.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.
1>Done building project "BattleRoyale.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I know my source engine is setup correctly because I can use it to build the DevelopmentServer configuration for any project without issue.

I have added the following lines to my InstalledEngineBuild.xml:


<ForEach Name="Configuration" Values="$(GameConfigurations)">
    <Compile Target="UE4Game" Platform="Win64" Configuration="$(Configuration)" Tag="#UE4Game Win64" Arguments="-precompile $(VSCompilerArg) $(TargetDebugInfoArg)"/>
    <Compile Target="UE4Server" Platform="Win64" Configuration="$(Configuration)" Tag="#UE4Game Win64" Arguments="-precompile $(VSCompilerArg) $(TargetDebugInfoArg)"/>
</ForEach>


<!-- Tag the generated includes for this target -->
<Tag Files="Engine/Intermediate/Build/Win64/UE4/Inc/...;Engine/Plugins/.../Intermediate/Build/Win64/UE4/Inc/..." With="#UE4Game Win64 Includes"/>
<Tag Files="Engine/Intermediate/Build/Win64/UE4Server/Inc/...;Engine/Plugins/.../Intermediate/Build/Win64/UE4Server/Inc/..." With="#UE4Game Win64 Includes"/>

The only things that have changed are:

  1. Source engine version (4.17.2 -> 4.20.2)
  2. The Visual Studio version (2015 -> 2017)

The things I have tried are:

  1. Delete the following project folders then regenerate visual studio project files: Binaries, Intermediate, Saved, .vs and .sln file.
  2. Ensure VS 2017 is installed with “Desktop development with C++” and “.NET desktop development” and “Game development with C++”.
  3. Create a Game.uprojectdirs file in the root of my installed build directory that points to my project location.
  4. Create a brand new project from the installed build, then copy the generated <ProjectName>EditorTarget.cs to create a <ProjectName>Server.Target.cs to ensure the format was correct.
  5. Rebuild the installed engine 3 different times.

Anybody have any ideas, cause I’m running out…hence me creating a thread about it.

Thanks!

Just found something disappointing in there documentation… Deploying Unreal Engine | Unreal Engine 5.3 Documentation

As of 4.19, under the ‘Using an Installed build’ section, the following is listed as a disadvantage:

Welp, glad I spent my weekend trying to troubleshoot this. Can anyone from Epic chime in as to why these targets are no longer supported?

You need source engine build (i.e. GitHub source code download) to do it. Installed builds (from Editor) don’t include everything you need. This tutorial (sorta outdated, but made edits up to 4.18) provides the methods in building Server/Editor targets.

https://wiki.unrealengine.com/Dedicated_Server_Guide_(Windows_%26_Linux)

Hope this helps!

It looks like you’ve forgotten to copy over the UE4Server.Target.cs from


<Path\To\Source\Build>\Engine\Source\

In your source build folder, to the same folder in your installed build, once you do that, packaging projects will work fine.

Looks like this limitation of Installed Engine Build is lifted already, at least for UE 4.26.x .
Documentation is still missing it, and is misleading. But in [FONT=Courier New]Engine\Build\InstalledEngineBuild.xml there are already options for doing this (and selecting many other things like included configurations) too:


<!-- Set up target types -->
<Option Name="WithClient" Restrict="true|false" DefaultValue="false" Description="Include precompiled client targets"/>
<Option Name="WithServer" Restrict="true|false" DefaultValue="false" Description="Include precompiled server targets"/>


<!-- Which game configurations to include for packaged applications -->
<Option Name="GameConfigurations" DefaultValue="DebugGame;Development;Shipping" Description="Which game configurations to include for packaged applications"/>


Use it with ‘[FONT=Courier New]-set:WithClient=true and -set:WithServer=true’ when invoking BuildGraph command with this script.