ApplocalPrerequisitesDirectory
ApplocalPrerequisitesDirectory
#Overview
name: ApplocalPrerequisitesDirectory
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 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of ApplocalPrerequisitesDirectory is to specify a directory containing additional prerequisite packages that should be staged in the executable directory during project packaging. This setting is part of the project packaging system in Unreal Engine 5.
The Unreal Engine subsystem that primarily relies on this setting variable is the Project Packaging system. It is defined in the DeveloperToolSettings module and used in the TurnkeySupport module.
The value of this variable is set in the project’s configuration files and can be edited through the Unreal Editor’s Project Settings interface. It is defined as a UPROPERTY with the ‘config’ and ‘EditAnywhere’ specifiers, allowing it to be saved in configuration files and edited in the editor.
This variable interacts with other packaging-related variables, particularly the IncludeAppLocalPrerequisites flag. If ApplocalPrerequisitesDirectory is empty and IncludeAppLocalPrerequisites is true, a default directory is used instead.
Developers must be aware that:
- The path can be relative to either $(EngineDir) or $(ProjectDir).
- The system attempts to make the path relative to these directories automatically if it doesn’t already contain a variable reference.
- If left empty, and IncludeAppLocalPrerequisites is true, a default engine directory will be used.
Best practices when using this variable include:
- Use relative paths when possible to maintain portability across different development environments.
- Ensure that the specified directory actually contains the necessary prerequisite packages.
- Be cautious when modifying this setting, as it can affect the correct packaging and deployment of your project.
- Consider using the default engine directory for app local prerequisites unless you have specific requirements that necessitate a custom directory.
#Setting Variables
#References In INI files
Location: <Workspace>/Projects/Lyra/Config/DefaultGame.ini:122, section: [/Script/UnrealEd.ProjectPackagingSettings]
- INI Section:
/Script/UnrealEd.ProjectPackagingSettings
- Raw value:
(Path="")
- 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:449
Scope (from outer to inner):
file
class class UProjectPackagingSettings : public UObject
Source code excerpt:
/** A directory containing additional prerequisite packages that should be staged in the executable directory. Can be relative to $(EngineDir) or $(ProjectDir) */
UPROPERTY(config, EditAnywhere, Category=Prerequisites, AdvancedDisplay)
FDirectoryPath ApplocalPrerequisitesDirectory;
/**
* Specifies whether to include the crash reporter in the packaged project.
* This is included by default for Blueprint based projects, but can optionally be disabled.
*/
UPROPERTY(config, EditAnywhere, Category=Packaging, AdvancedDisplay)
#Loc: <Workspace>/Engine/Source/Developer/DeveloperToolSettings/Private/ProjectPackagingSettings.cpp:147
Scope (from outer to inner):
file
function void UProjectPackagingSettings::PostEditChangeProperty
Source code excerpt:
{
// If a variable is already in use, assume the user knows what they are doing and don't modify the path
if (!ApplocalPrerequisitesDirectory.Path.Contains("$("))
{
// Try making the path local to either project or engine directories.
FString EngineRootedPath = ApplocalPrerequisitesDirectory.Path;
FString EnginePath = FPaths::ConvertRelativePathToFull(FPaths::GetPath(FPaths::EngineDir())) + "/";
FPaths::MakePathRelativeTo(EngineRootedPath, *EnginePath);
if (FPaths::IsRelative(EngineRootedPath))
{
ApplocalPrerequisitesDirectory.Path = "$(EngineDir)/" + EngineRootedPath;
return;
}
FString ProjectRootedPath = ApplocalPrerequisitesDirectory.Path;
FString ProjectPath = FPaths::ConvertRelativePathToFull(FPaths::GetPath(FPaths::GetProjectFilePath())) + "/";
FPaths::MakePathRelativeTo(ProjectRootedPath, *ProjectPath);
if (FPaths::IsRelative(EngineRootedPath))
{
ApplocalPrerequisitesDirectory.Path = "$(ProjectDir)/" + ProjectRootedPath;
return;
}
}
}
}
#Loc: <Workspace>/Engine/Source/Editor/TurnkeySupport/Private/TurnkeySupportModule.cpp:450
Scope (from outer to inner):
file
class class FTurnkeySupportCallbacks
function static void CookOrPackage
Source code excerpt:
}
if (!PackagingSettings->ApplocalPrerequisitesDirectory.Path.IsEmpty())
{
BuildCookRunParams += FString::Printf(TEXT(" -applocaldirectory=\"%s\""), *(PackagingSettings->ApplocalPrerequisitesDirectory.Path));
}
else if (PackagingSettings->IncludeAppLocalPrerequisites)
{
BuildCookRunParams += TEXT(" -applocaldirectory=\"$(EngineDir)/Binaries/ThirdParty/AppLocalDependencies\"");
}