Game Prerequisites Installer Options

Prerequisite installer options offered by Epic Games

Epic Games offers three prerequisite installer options:

Before You Start

When you build an application that uses library DLLs supplied by Visual Studio, users of your application must also have those DLLs on their computers for the application to run. Because most users probably do not have Visual Studio installed, you must provide these DLLs for them. Visual Studio makes these DLLs available as redistributable files that you can include in your application installer.

App-Local Deployment

When packaging your game for upload via the BuildPatchTool, you can include your prerequisites installation by copying the necessary dynamic-link libraries (DLLs) into the same directory as your game executable.

This method is not the only way to include your prerequisites installation, but it is Epic Games' preferred practice. The benefits of using app-local deployment are that it does not require elevated user access nor alter the system for all users.

However, this method may not work for you if you need a more complicated installation. It is also possible that not all redistributable DLLs can be distributed this way. Alternative methods include the Epic Games Launcher via the BuildPatchTool Command Line.

How to do it

Copy the necessary Visual Studio DLLs from their install directory to your application's directory. Use the following articles from Microsoft to identify the DLLs you must bundle with your application: Determining Which DLLs to Redistribute and Walkthrough: Deploying a Visual C++ Application to an Application-local Folder.

Epic Games Launcher via the BuildPatchTool Command Line

If copying the dependent DLLs is not a viable solution, then you can have the Epic Games Launcher run an installer upon first launch of the game. The installer is skipped if the associated IDs are already installed on the local machine, so users only see the installation process the first time or when including new dependencies.

Configuring a prerequisite installation with the Epic Games Launcher allows you to run a full installer. However, there are significant drawbacks. Users may decline, not see, or misunderstand the elevation prompt if offered, and any non-zero return code from the prerequisite installer can cause issues. Also, installing Visual Studio DLLs by this method can cause them to fail and result in your application not running. For more information, see Choosing a Deployment Method from Microsoft's website.

How to do it

To configure a prerequisite installer with the Epic Games Launcher, you use BuildPatchTool command line arguments. The following batch file snippet example shows how to run the UE3Redist installer as your first step.

SET UE3_PREREQ_IDS="UE3Redist,NotSharedReq,SharedReq2,SharedReq3"
SET UE3_PREREQ_NAME="UE3 Redistributables"
SET UE3_PREREQ_PATH="Binaries\Windows\UE3Redist.exe"
SET UE3_PREREQ_ARGS=""

BuildPatchTool … -mode=PatchGeneration -PrereqIds=%UE3_PREREQ_IDS%
  -PrereqName=%UE3_PREREQ_NAME% -PrereqPath=%UE3_PREREQ_PATH%
  -PrereqArgs=%UE3_PREREQ_ARGS%

This configuration assumes:

  • Your prerequisite installer lives in a Binaries\Windows subdirectory

  • The prerequisites have a human readable name

  • The prerequisite IDs determine whether the installer is launched or not

  • Each ID is unique for each prerequisite within a comma-delimited list (no spaces) as a way to share prerequisites across multiple games

This method can also trigger another install if a subsequent update to your game adds new prerequisites. You would need to add a new unique ID to the list of prerequisites. The launcher would recognize the new ID as not installed causing it to launch your installer again. Once the installer completes successfully, the launcher marks those IDs as installed on the local machine and does not launch the installer again.

Batch Script

If the preferred methods above do not work for your game, you can use a batch file to conditionally check for the prerequisites being installed before passing through to your game. This method is simple to develop and flexible. However, a DOS box flashes briefly when your game is run from the Epic Games Launcher. Also, with a slow installation (greater than two minutes), your exchange code could expire before it is passed onto the game causing you to relaunch the game.

How to do it

Create a batch file that you will use as your executable as specified in BuildPatchTool. This batch file needs to check for the prerequisites and then forward the command line arguments on to your game. The following batch file is a hypothetical UE3 title that requires the UE3Redist.exe installer to be run on the player's machine. It is set up to be run from the Binaries directory and has the UE3Redist.exe installer in a Windows subdirectory.

reg query HKEY_CLASSES_ROOT\Installer\Products\70140BF22CB7C94419A535B0925B0EEF

if %ERRORLEVEL% EQU 0 goto LAUNCH_UE3_GAME

.\Windows\UE3Redist.exe

:LAUNCH_UE3_GAME
UE3Game.com %*

The BuildPatchTool setup for this is:

BuildPatchTool … -mode=PatchGeneration -FeatureLevel=Latest -AppLaunch="Binaries\UE3Game.bat" …