ProjectVersion
ProjectVersion
#Overview
name: ProjectVersion
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 19
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 ProjectVersion is to represent and manage the version number of the Unreal Engine project. This variable is used across various subsystems of the Unreal Engine to identify and track the current version of the project being developed or executed.
ProjectVersion is utilized by several Unreal Engine subsystems, plugins, and modules, including:
- Concert (multi-user collaboration system)
- Game Project Generation
- Network version management
- Engine Analytics
- HTTP module for user agent string generation
The value of ProjectVersion is typically set in the project’s General Settings. It can be accessed and modified through the UGeneralProjectSettings class, which is part of the EngineSettings module.
ProjectVersion interacts with other variables and systems, such as:
- EngineVersion: Used for comparison and compatibility checks
- NetworkVersion: Utilized for network protocol versioning
- Analytics systems: Included in analytics data for tracking and reporting
Developers should be aware of the following when using ProjectVersion:
- It’s crucial for version control and compatibility checks between different builds of the project.
- Changing the ProjectVersion can affect network compatibility and analytics reporting.
- It’s used in user agent strings for HTTP requests, which may impact how external services interact with the project.
Best practices for using ProjectVersion include:
- Keep it up to date with each significant change or release of the project.
- Follow a consistent versioning scheme (e.g., Semantic Versioning) to make version comparisons and management easier.
- Coordinate ProjectVersion changes with the team to ensure consistency across different aspects of the project (e.g., networking, analytics).
- Document any changes to ProjectVersion and their implications for the project’s systems and external integrations.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseGame.ini:80, section: [/Script/EngineSettings.GeneralProjectSettings]
- INI Section:
/Script/EngineSettings.GeneralProjectSettings
- Raw value:
1.0.0.0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertUI/ConcertSharedSlate/Source/ConcertSharedSlate/Private/Session/Browser/SConcertSessionBrowser.cpp:342
Scope (from outer to inner):
file
function void SConcertSessionBrowser::SortSessionList
lambda-function
Source code excerpt:
if (ColName == ConcertBrowserUtils::VersionColName)
{
return SortMode == EColumnSortMode::Ascending ? Lhs->ProjectVersion < Rhs->ProjectVersion : Lhs->ProjectVersion > Rhs->ProjectVersion;
}
if (ColName == ConcertBrowserUtils::LastModifiedColName)
{
return SortMode == EColumnSortMode::Ascending ? Lhs->LastModified < Rhs->LastModified : Lhs->LastModified > Rhs->LastModified;
}
else
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertUI/ConcertSharedSlate/Source/ConcertSharedSlate/Private/Session/Browser/SSessionRow.cpp:153
Scope (from outer to inner):
file
lambda-function
Source code excerpt:
[
SNew(SInlineEditableTextBlock)
.Text_Lambda([this]() { return FText::AsCultureInvariant(Item.Pin()->ProjectVersion); })
.HighlightText(HighlightText)
.IsReadOnly(true)
.Font(FontInfo)
.ColorAndOpacity(FontColor)
];
}
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertUI/ConcertSharedSlate/Source/ConcertSharedSlate/Public/Session/Browser/Items/ConcertSessionTreeItem.h:29
Scope (from outer to inner):
file
class class FConcertSessionTreeItem : public FConcertTreeItem
function FConcertSessionTreeItem
Source code excerpt:
const FString& ServerName = {},
const FString& ProjectName = {},
const FString& ProjectVersion = {},
EConcertServerFlags ServerFlags = {},
const FDateTime& LastModified = {},
const FOnBeginEditConcertSessionNameRequest& OnBeginEditSessionNameRequest = {}
)
: Type(Type)
, ServerAdminEndpointId(ServerAdminEndpointId)
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertUI/ConcertSharedSlate/Source/ConcertSharedSlate/Public/Session/Browser/Items/ConcertSessionTreeItem.h:40
Scope (from outer to inner):
file
class class FConcertSessionTreeItem : public FConcertTreeItem
function FConcertSessionTreeItem
Source code excerpt:
, ServerName(ServerName)
, ProjectName(ProjectName)
, ProjectVersion(ProjectVersion)
, ServerFlags(ServerFlags)
, LastModified(LastModified)
, OnBeginEditSessionNameRequest(OnBeginEditSessionNameRequest)
{}
bool operator==(const FConcertSessionTreeItem& Other) const
#Loc: <Workspace>/Engine/Plugins/Developer/Concert/ConcertUI/ConcertSharedSlate/Source/ConcertSharedSlate/Public/Session/Browser/Items/ConcertSessionTreeItem.h:66
Scope (from outer to inner):
file
class class FConcertSessionTreeItem : public FConcertTreeItem
Source code excerpt:
FString ServerName;
FString ProjectName;
FString ProjectVersion;
EConcertServerFlags ServerFlags = EConcertServerFlags::None;
FDateTime LastModified;
FOnBeginEditConcertSessionNameRequest OnBeginEditSessionNameRequest; // Emitted when user press 'F2' or select 'Rename' from context menu.
};
#Loc: <Workspace>/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp:109
Scope: file
Source code excerpt:
FText Category;
FString EngineIdentifier;
FEngineVersion ProjectVersion;
FString ProjectFile;
TArray<FName> TargetPlatforms;
TSharedPtr<FSlateBrush> ProjectThumbnail;
FDateTime LastAccessTime;
bool bUpToDate;
bool bSupportsAllPlatforms;
#Loc: <Workspace>/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp:130
Scope (from outer to inner):
file
function FProjectItem
Source code excerpt:
if(bUpToDate)
{
ProjectVersion = FEngineVersion::Current();
}
else if (FDesktopPlatformModule::Get()->IsStockEngineRelease(EngineIdentifier))
{
FDesktopPlatformModule::Get()->TryParseStockEngineVersion(EngineIdentifier, ProjectVersion);
}
if (ProjectVersion.IsEmpty())
{
FString RootDir;
FDesktopPlatformModule::Get()->GetEngineRootDirFromIdentifier(EngineIdentifier, RootDir);
FDesktopPlatformModule::Get()->TryGetEngineVersion(RootDir, ProjectVersion);
}
}
/** Check if this project is up to date */
bool IsUpToDate() const
{
#Loc: <Workspace>/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp:163
Scope (from outer to inner):
file
function FText GetEngineLabel
Source code excerpt:
return FText::FromString(EngineIdentifier);
}
else if(!ProjectVersion.IsEmpty())
{
return FText::FromString(ProjectVersion.ToString(EVersionComponent::Patch));
}
else
{
return FText::FromString(TEXT("?"));
}
}
#Loc: <Workspace>/Engine/Source/Editor/GameProjectGeneration/Private/SProjectBrowser.cpp:176
Scope (from outer to inner):
file
function bool CompareEngineVersion
Source code excerpt:
{
EVersionComponent Component;
return FEngineVersion::GetNewest(ProjectVersion, Other.ProjectVersion, &Component) == EVersionComparison::First ? true : false;
}
};
class SProjectTile : public STableRow<TSharedPtr<FProjectItem>>
{
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/NetworkVersion.cpp:87
Scope (from outer to inner):
file
function FString& FNetworkVersion::GetProjectVersion_Internal
Source code excerpt:
FString& FNetworkVersion::GetProjectVersion_Internal()
{
static FString ProjectVersion = TEXT("1.0.0");
return ProjectVersion;
}
bool FNetworkVersion::bHasCachedNetworkChecksum = false;
uint32 FNetworkVersion::CachedNetworkChecksum = 0;
bool FNetworkVersion::bHasCachedReplayChecksum = false;
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/Misc/NetworkVersion.cpp:107
Scope (from outer to inner):
file
function void FNetworkVersion::SetProjectVersion
Source code excerpt:
if (ensureMsgf(InVersion != nullptr && FCString::Strlen(InVersion), TEXT("ProjectVersion used for network version must be a valid string!")))
{
FString& ProjectVersion = GetProjectVersion_Internal();
ProjectVersion = InVersion;
bHasCachedNetworkChecksum = false;
UE_LOG(LogNetVersion, Log, TEXT("Set ProjectVersion to %s. Version Checksum will be recalculated on next use."), *ProjectVersion);
}
}
void FNetworkVersion::SetGameNetworkProtocolVersion(const uint32 InGameNetworkProtocolVersion)
{
FCustomVersionContainer& NetworkCustomVersions = UE::Net::Private::GetNetworkCustomVersions();
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Analytics/EngineAnalyticsSessionSummary.cpp:182
Scope (from outer to inner):
file
function FEngineAnalyticsSessionSummary::FEngineAnalyticsSessionSummary
Source code excerpt:
Store->Set(TEXT("ProjectID"), ProjectSettings.ProjectID.ToString(EGuidFormats::DigitsWithHyphens));
Store->Set(TEXT("ProjectDescription"), ProjectSettings.Description);
Store->Set(TEXT("ProjectVersion"), ProjectSettings.ProjectVersion);
Store->Set(TEXT("EngineVersion"), FEngineVersion::Current().ToString(EVersionComponent::Changelist));
Store->Set(TEXT("CommandLine"), FString(FCommandLine::GetForLogging()));
Store->Set(TEXT("MonitorPid"), CrcProcessId); // CrashReportClient acts as the monitoring/reporting process.
Store->Set(TEXT("Plugins"), FString::Join(PluginNames, TEXT(",")));
Store->Set(TEXT("IsCrcMissing"), CrcProcessId != 0 ? false : EngineAnalyticsProperties::IsCrcExecutableMissing()); // CrashReportClient is the monitor process. If we have a process id, it's not missing.
Store->Set(TEXT("IsInEnterprise"), IProjectManager::Get().IsEnterpriseProject());
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/EngineAnalytics.cpp:250
Scope (from outer to inner):
file
function void FEngineAnalytics::AppendMachineStats
Source code excerpt:
EventAttributes.Emplace(TEXT("ProjectID"), ProjectSettings.ProjectID);
EventAttributes.Emplace(TEXT("ProjectDescription"), ProjectSettings.Description);
EventAttributes.Emplace(TEXT("ProjectVersion"), ProjectSettings.ProjectVersion);
EventAttributes.Emplace(TEXT("Application.Commandline"), FCommandLine::Get());
EventAttributes.Emplace(TEXT("Build.Configuration"), LexToString(FApp::GetBuildConfiguration()));
EventAttributes.Emplace(TEXT("Build.IsInternalBuild"), FEngineBuildSettings::IsInternalBuild());
EventAttributes.Emplace(TEXT("Build.IsPerforceBuild"), FEngineBuildSettings::IsPerforceBuild());
EventAttributes.Emplace(TEXT("Build.IsPromotedBuild"), FApp::GetEngineIsPromotedBuild() == 0 ? false : true);
EventAttributes.Emplace(TEXT("Build.BranchName"), FApp::GetBranchName());
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/UnrealEngine.cpp:2096
Scope (from outer to inner):
file
function void UEngine::Init
Source code excerpt:
// Make sure networking checksum has access to project version
const UGeneralProjectSettings& ProjectSettings = *GetDefault<UGeneralProjectSettings>();
FNetworkVersion::SetProjectVersion(*ProjectSettings.ProjectVersion);
#if !(UE_BUILD_SHIPPING) || ENABLE_PGO_PROFILE
// Optionally Exec an exec file
FString Temp;
if (FParse::Value(FCommandLine::Get(), TEXT("EXEC="), Temp))
{
#Loc: <Workspace>/Engine/Source/Runtime/EngineSettings/Classes/GeneralProjectSettings.h:53
Scope (from outer to inner):
file
class class UGeneralProjectSettings : public UObject
Source code excerpt:
/** The project's version number. */
UPROPERTY(config, EditAnywhere, Category=About)
FString ProjectVersion;
/** The project's support contact information. */
UPROPERTY(config, EditAnywhere, Category=Publisher)
FString SupportContact;
/** The project's title as displayed on the window title bar (can include the tokens {GameName}, {PlatformArchitecture}, {BuildConfiguration} or {RHIName}, which will be replaced with the specified text) */
#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Private/GenericPlatform/GenericPlatformHttp.cpp:137
Scope (from outer to inner):
file
function FDefaultUserAgentBuilder::FDefaultUserAgentBuilder
Source code excerpt:
FDefaultUserAgentBuilder::FDefaultUserAgentBuilder()
: ProjectName(FApp::GetProjectName())
, ProjectVersion(FApp::GetBuildVersion())
, ProjectComments()
, PlatformName(FString(FPlatformProperties::IniPlatformName()))
, PlatformVersion(FPlatformMisc::GetOSVersion())
, PlatformComments()
, AgentVersion(1)
{
#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Private/GenericPlatform/GenericPlatformHttp.cpp:151
Scope (from outer to inner):
file
function FString FDefaultUserAgentBuilder::BuildUserAgentString
Source code excerpt:
return FString::Printf(TEXT("%s/%s%s %s/%s%s"),
*FGenericPlatformHttp::EscapeUserAgentString(ProjectName),
*FGenericPlatformHttp::EscapeUserAgentString(ProjectVersion),
*BuildCommentString(ProjectComments, AllowedProjectCommentsFilter),
*FGenericPlatformHttp::EscapeUserAgentString(PlatformName),
*FGenericPlatformHttp::EscapeUserAgentString(PlatformVersion),
*BuildCommentString(PlatformComments, AllowedPlatformCommentsFilter));
}
#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Private/GenericPlatform/GenericPlatformHttp.cpp:166
Scope (from outer to inner):
file
function void FDefaultUserAgentBuilder::SetProjectVersion
Source code excerpt:
void FDefaultUserAgentBuilder::SetProjectVersion(const FString& InProjectVersion)
{
ProjectVersion = InProjectVersion;
++AgentVersion;
}
void FDefaultUserAgentBuilder::AddProjectComment(const FString& InComment)
{
ProjectComments.AddUnique(InComment);
#Loc: <Workspace>/Engine/Source/Runtime/Online/HTTP/Public/GenericPlatform/GenericPlatformHttp.h:42
Scope (from outer to inner):
file
class class FDefaultUserAgentBuilder
Source code excerpt:
FString ProjectName;
FString ProjectVersion;
TArray<FString> ProjectComments;
FString PlatformName;
FString PlatformVersion;
TArray<FString> PlatformComments;
uint32 AgentVersion;
};
#References in C# build files
This variable is referenced in the following C# build files:
Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/Platform/Android/UEDeployAndroid.cs:2606
ConfigHierarchy GameIni = GetConfigCacheIni(ConfigHierarchyType.Game);
string ProjectVersion;
GameIni.GetString("/Script/EngineSettings.GeneralProjectSettings", "ProjectVersion", out ProjectVersion);
// ini file to get settings from
ConfigHierarchy Ini = GetConfigCacheIni(ConfigHierarchyType.Engine);
string PackageName = GetPackageName(ProjectName);
string VersionDisplayName = GetVersionDisplayName(bIsEmbedded);
string DepthBufferPreference;