In order for users to run products that use dynamic-link libraries (DLLs) supplied by Visual Studio, those DLLs must be available on their local machine. To ensure user success, you must provide these DLLs to users as most will not have Visual Studio installed. Visual Studio can provide these DLLs as redistributable files that can be included in your application installer.
Epic Games offers three prerequisite installer options:
When packaging your product for upload via the BuildPatchTool, you can include most redistributable files by copying the necessary DLLs into the same directory as your application executable. This method of distribution is recommended as best practice as it does not require elevated user access nor alter the system for all users.
If your product requires a more complicated installation or uses DLLs that cannot be distributed this way, other methods are available. If you cannot use app-local deployment, review the Epic Games Launcher via the BuildPatchTool Command Line section for an alternative option.
To use this app-local deployment, copy the necessary Visual Studio DLLs from their install directory to your application’s directory.
Review the following Microsoft documentation to identify the DLLs you must bundle with your application:
- Determining Which DLLs to Redistribute
- Walkthrough: Deploying a Visual C++ Application to an Application-local Folder.
Epic Games Launcher via the BuildPatchTool Command Line
If you cannot use app-local deployment, you can have the Epic Games launcher run an installer upon users' first launch of your product. As the Epic Games launcher records any installers that have already been completed for a product, users only see the installation process upon first access or when new dependencies are included.
While this option allows you to run a full installer, there are considerable disadvantages to using this method. Users may decline, overlook, or misunderstand the elevation prompt when offered, and any non-zero return code from the prerequisite installer, aside from 1638 and 3010, can cause issues. Additionally, installing Visual Studio DLLs through this method can lead to failures that prevent your application from running. For more information, review the Microsoft documentation on Choosing a Deployment Method.
The process for configuring a prerequisite installer with the Epic Games launcher uses BuildPatchTool command line arguments.
The following batch file snippet example demonstrates how to run the UE3Redist installer as the first step.
This configuration assumes the following:
- Your prerequisite installer lives in a Binaries\Windows subdirectory.
- The prerequisites have a human-readable name.
- The prerequisite IDs determine whether or not the installer launches.
This method can also trigger another install if a subsequent update to your game adds new prerequisites. In this case, add a new unique ID to the list of prerequisites. Each ID is unique for each prerequisite within a comma-delimited list (no spaces) as a way to share prerequisites across multiple games.
When a prerequisite is added, the launcher recognizes the new ID is not installed and relaunches your installer. Once the installer completes successfully, the launcher marks those IDs as installed on the local machine and will not run the installer again.
If the preferred methods outlined above do not work for your product, you can use a batch file to conditionally check for the prerequisites being installed before passing through to your application.
While this method is straightforward to develop and offers flexibility, there are considerations. With this method, a Command Prompt window flashes briefly when users access your game from the Epic Games Launcher. Additionally, during a slow installation (longer than five minutes), your exchange code may expire before it is passed onto the application causing the product to be relaunched.
To use this method, create a batch file to use as your executable as specified in BuildPatchTool. This batch file must check for the prerequisites, then forward the command line arguments to your application.
The following batch file is a hypothetical UE3 title that requires the UE3Redist.exe installer to run on the user's machine. The file is set up to run from the Binaries directory and includes the UE3Redist.exe installer in a Windows subdirectory.
The BuildPatchTool setup for this is as follows: