Configure build for different windows stores.

Hi!

We are building one of our apps for several Windows stores (Epic, Steam and standalone), and we want to build a different package for each one, with the right configuration for each of the stores (plugins, app ids, output folders…).

Which is the best approach? To create a different Build target for each one? Or use the default Build target, and use some build arguments in order to select the build flavor and setup the build accordingly?

Right now we’ve started with the creation of a different Build Target for each one, and, in our first configuration steps of the pipeline, to output the build and intermediate results into a different folder for each of the stores, but when be build, the resulting .exe name is the same as the name of the Target File we’re using. Is there a way to set the name of the resulting .exe file independently of the Build Target name?

Thanks.

Hello [mention removed]​,

Both approaches are valid but behave differently.

Using a separate target file per store works but the packaged .exe will always match the Target name. Renaming the executable manually is not recommended, due to the internal metadata in the rest of the project.

If you want to produce the same .exe name across all store builds, a better approach would be to use a single target that branches its behavior based on a parameter passed during build. Here’s an example for UE 5.5 (built from source):

`using UnrealBuildTool;
using System.Collections.Generic;
using EpicGames.Core;
using System;

public class MyGameTarget : TargetRules
{

public MyGameTarget(TargetInfo Target) : base(Target)
{

Type = TargetType.Game;
DefaultBuildSettings = BuildSettingsVersion.V5;
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_5;
ExtraModuleNames.Add(“MyProject”);

string cmdLine = Environment.CommandLine.ToLowerInvariant();

bool bSteamBuild = cmdLine.Contains(“-steam”);
bool bEpicBuild = cmdLine.Contains(“-epic”);

if (bSteamBuild)
{
GlobalDefinitions.Add(“GAME_STORE=STEAM”);
}else if (bEpicBuild)
{
GlobalDefinitions.Add(“GAME_STORE=EPIC”);
}
}
}`This setup lets you configure store-specific behavior without changing the executable name, which will always be MyGame.exe in this case.

To pass the store argument, you can run the build through a .bat script like this (eg, BuildStoreTarget.bat)

`@echo off

REM === Store can be STEAM, EPIC, or leave empty for standalone
set STORE=%1
set ENGINE_DIR=D:\P4\5.5.4\Engine
set PROJECT_DIR=%cd%
set TARGET_NAME=MyGame

REM === Run the build
call “%ENGINE_DIR%\Build\BatchFiles\RunUAT.bat” BuildCookRun ^
-project=“%PROJECT_DIR%\MyProject.uproject” ^
-noP4 -platform=Win64 -clientconfig=Development ^
-target=%TARGET_NAME% -build -cook -stage -pak -%STORE% -archive ^
-archivedirectory=“%PROJECT_DIR%\Packaged%STORE%”`You can run it like this from the project root:

BuildStoreTarget.bat STEAMSome key points:

  • This. bat script should live next to your .uproject.
  • Output will be packaged into Packaged/STEAM (or EPIC/, etc.)
  • You can use GlobalDefinitions to pass macros into your C++ code and change behavior based on the store.

Please let me know if this information helps.

Best,

Francisco

Hi Francisco.

Thanks for the answer. I think for our project this will be useful.

Cheers.

Emilio.

Glad to hear that! I’ll go ahead and close this case, but feel free to open a new one if you have any follow-up questions or need help with related topics.

Best,

Francisco