ForDistribution
ForDistribution
#Overview
name: ForDistribution
The value of this variable can be defined or overridden in .ini config files. 1
.ini config file referencing this setting variable.
It is referenced in 13
C++ source files. Also referenced in 1
C# build file meaning it may affect the build system logic.
#Summary
#Usage in the C++ source code
The purpose of ForDistribution is to indicate whether the project is being built for distribution or not. This setting variable is primarily used in the context of project packaging and deployment.
ForDistribution is part of the UProjectPackagingSettings class, which is part of the DeveloperToolSettings module. This variable is used across various Unreal Engine subsystems, including:
- Project Packaging
- Launcher Services
- iOS Target Platform
- Turnkey Support
The value of this variable is typically set in the project’s packaging settings, either through the Unreal Editor interface or by modifying the configuration files directly.
ForDistribution interacts with several other variables and settings, such as:
- BuildConfiguration: When ForDistribution is set to true, it forces the BuildConfiguration to PPBC_Shipping.
- EncryptIniFiles: Often used in conjunction with ForDistribution for secure packaging.
- IncludeDebugFiles: Affects whether debug files are included in shipping builds.
Developers must be aware of the following when using this variable:
- Setting ForDistribution to true will automatically set the build configuration to Shipping, overriding any other build configuration settings.
- It affects various aspects of the packaging process, including how files are handled and what content is included in the final build.
- It may impact platform-specific settings and behaviors, such as those for iOS.
Best practices when using this variable include:
- Only set ForDistribution to true when preparing a final release build for distribution to end-users.
- Ensure all necessary content and settings are properly configured before enabling ForDistribution, as it may limit certain debug options.
- Review and test the packaged build thoroughly when ForDistribution is enabled, as it may behave differently from development builds.
- Consider the implications on platform-specific settings and requirements when enabling ForDistribution.
- Use in conjunction with other related settings like EncryptIniFiles for secure distribution builds.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:89, section: [/Script/UnrealEd.ProjectPackagingSettings]
- INI Section:
/Script/UnrealEd.ProjectPackagingSettings
- Raw value:
False
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Classes/Settings/ProjectPackagingSettings.h:231
Scope (from outer to inner):
file
class class UProjectPackagingSettings : public UObject
Source code excerpt:
*/
UPROPERTY(config, EditAnywhere, Category=Project)
bool ForDistribution;
/** If enabled, debug files will be included in staged shipping builds. */
UPROPERTY(config, EditAnywhere, Category=Project, meta = (DisplayName = "Include Debug Files in Shipping Builds"))
bool IncludeDebugFiles;
/** If enabled, then the project's Blueprint assets (including structs and enums) will be intermediately converted into C++ and used in the packaged project (in place of the .uasset files).*/
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/ProjectPackagingSettings.cpp:104
Scope (from outer to inner):
file
function void UProjectPackagingSettings::PostEditChangeProperty
Source code excerpt:
else if (Name == FName(TEXT("ForDistribution")))
{
if (ForDistribution && BuildConfiguration != EProjectPackagingBuildConfigurations::PPBC_Shipping)
{
BuildConfiguration = EProjectPackagingBuildConfigurations::PPBC_Shipping;
// force serialization for "Build COnfiguration"
UpdateSinglePropertyInConfigFile(GetClass()->FindPropertyByName(GET_MEMBER_NAME_CHECKED(UProjectPackagingSettings, BuildConfiguration)), GetDefaultConfigFilename());
}
}
#Loc: <Workspace>/Engine/Source/Developer/IOS/IOSTargetPlatform/Private/IOSTargetPlatform.cpp:262
Scope (from outer to inner):
file
function int32 FIOSTargetPlatform::CheckRequirements
Source code excerpt:
bool bForDistribtion = false;
GConfig->GetBool(TEXT("/Script/UnrealEd.ProjectPackagingSettings"), TEXT("ForDistribution"), bForDistribtion, GGameIni);
FString BundleIdentifier;
GConfig->GetString(TEXT("/Script/IOSRuntimeSettings.IOSRuntimeSettings"), TEXT("BundleIdentifier"), BundleIdentifier, GEngineIni);
BundleIdentifier = BundleIdentifier.Replace(TEXT("[PROJECT_NAME]"), FApp::GetProjectName());
BundleIdentifier = BundleIdentifier.Replace(TEXT("_"), TEXT(""));
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:829
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual bool IsForDistribution
Source code excerpt:
virtual bool IsForDistribution() const override
{
return ForDistribution;
}
virtual bool IsCookingUnversioned( ) const override
{
return CookUnversioned;
}
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:995
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual bool Serialize
Source code excerpt:
{
Archive << EncryptIniFiles;
Archive << ForDistribution;
}
if (Version >= LAUNCHERSERVICES_ADDEDDEFAULTDEPLOYPLATFORM)
{
Archive << DeployPlatformString;
}
if (Version >= LAUNCHERSERVICES_ADDEDNUMCOOKERSTOSPAWN && Version < LAUNCHERSERVICES_REMOVEDNUMCOOKERSTOSPAWN)
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:1222
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual void Save
Source code excerpt:
Writer.WriteValue("Compressed", Compressed);
Writer.WriteValue("EncryptIniFiles", EncryptIniFiles);
Writer.WriteValue("ForDistribution", ForDistribution);
Writer.WriteValue("DeployPlatform", DefaultDeployPlatform.ToString());
Writer.WriteValue("SkipCookingEditorContent", bSkipCookingEditorContent);
Writer.WriteValue("DeployIncremental", DeployIncremental);
Writer.WriteValue("GeneratePatch", GeneratePatch);
Writer.WriteValue("AddPatchLevel", AddPatchLevel);
Writer.WriteValue("StageBaseReleasePaks", StageBaseReleasePaks);
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:1856
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual bool Load
Source code excerpt:
{
EncryptIniFiles = Object.GetBoolField(TEXT("EncryptIniFiles"));
ForDistribution = Object.GetBoolField(TEXT("ForDistribution"));
}
else
{
EncryptIniFiles = false;
ForDistribution = false;
}
DefaultDeployPlatform = *(Object.GetStringField(TEXT("DeployPlatform")));
bSkipCookingEditorContent = Object.GetBoolField(TEXT("SkipCookingEditorContent"));
DeployIncremental = Object.GetBoolField(TEXT("DeployIncremental"));
GeneratePatch = Object.GetBoolField(TEXT("GeneratePatch"));
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:2040
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual void SetDefaults
Source code excerpt:
Compressed = true;
EncryptIniFiles = false;
ForDistribution = false;
CookedCultures.Reset();
CookedCultures.Add(I18N.GetCurrentCulture()->GetName());
CookedMaps.Reset();
CookedPlatforms.Reset();
bSkipCookingEditorContent = false;
ForceClose = true;
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:2354
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
function virtual void SetForDistribution
Source code excerpt:
virtual void SetForDistribution(bool Enabled)override
{
if (ForDistribution != Enabled)
{
ForDistribution = Enabled;
Validate();
}
}
virtual void SetEncryptingIniFiles(bool Enabled) override
#Loc: <Workspace>/Engine/Source/Developer/LauncherServices/Private/Profiles/LauncherProfile.h:3091
Scope (from outer to inner):
file
class class FLauncherProfile final : public ILauncherProfile
Source code excerpt:
bool EncryptIniFiles;
// is this build for distribution
bool ForDistribution;
// Holds a flag indicating whether only modified content should be cooked.
bool CookIncremental;
// hold a flag indicating if we want to iterate on the shared cooked build
bool IterateSharedCookedBuild;
#Loc: <Workspace>/Engine/Source/Editor/TurnkeySupport/Private/TurnkeySupportModule.cpp:461
Scope (from outer to inner):
file
class class FTurnkeySupportCallbacks
function static void CookOrPackage
Source code excerpt:
BuildCookRunParams += FString::Printf(TEXT(" -archivedirectory=\"%s\""), *PlatformsSettings->StagingDirectory.Path);
if (PackagingSettings->ForDistribution)
{
BuildCookRunParams += TEXT(" -distribution");
}
if (PackagingSettings->bGenerateChunks)
{
#Loc: <Workspace>/Engine/Source/Editor/TurnkeySupport/Private/TurnkeySupportModule.cpp:490
Scope (from outer to inner):
file
class class FTurnkeySupportCallbacks
function static void CookOrPackage
Source code excerpt:
// when distribution is set, always package in shipping, which overrides the per platform build config
if (PackagingSettings->ForDistribution)
{
BuildConfig = EProjectPackagingBuildConfigurations::PPBC_Shipping;
}
const UProjectPackagingSettings::FConfigurationInfo& ConfigurationInfo = UProjectPackagingSettings::ConfigurationInfo[(int)BuildConfig];
if (BuildTargetInfo)
#Loc: <Workspace>/Engine/Source/Editor/TurnkeySupport/Private/TurnkeySupportModule.cpp:614
Scope (from outer to inner):
file
class class FTurnkeySupportCallbacks
function static FString GetCustomBuildCommandLine
Source code excerpt:
// distribution builds can set shipping
EProjectPackagingBuildConfigurations BuildConfig = PlatformPackagingSettings->ForDistribution ?
EProjectPackagingBuildConfigurations::PPBC_Shipping :
PlatformsSettings->GetBuildConfigurationForPlatform(IniPlatformName);
// if PPBC_MAX is set, then the project default should be used instead of the per platform build config
if (BuildConfig == EProjectPackagingBuildConfigurations::PPBC_MAX)
{
#References in C# build files
This variable is referenced in the following C# build files:
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/IOS/UEBuildIOS.cs:338
/// true when building for distribution
/// </summary>
[ConfigFile(ConfigHierarchyType.Game, "/Script/UnrealEd.ProjectPackagingSettings", "ForDistribution")]
public readonly bool bForDistribution = false;
/// <summary>
/// override for the app's display name if different from the project name
/// </summary>
[ConfigFile(ConfigHierarchyType.Game, "/Script/UnrealEd.ProjectPackagingSettings", "BundleName")]