StoreVersion

StoreVersion

#Overview

name: StoreVersion

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 4 C++ source files. Also referenced in 2 C# build files meaning it may affect the build system logic.

#Summary

#Usage in the C++ source code

The purpose of StoreVersion is to manage version information for different aspects of the Unreal Engine ecosystem, including the trace service, Android APK packaging, and iOS app updates.

This setting variable is used across multiple Unreal Engine subsystems:

  1. Insights module: In the TraceInsights system, it’s used to retrieve and store the version of the trace store service.
  2. Android Runtime Settings: It’s used to specify the version number for Android APK packaging.
  3. iOS Application Core: It’s used to check for available updates in the iOS App Store.

The value of this variable is set differently depending on the context:

  1. In the Insights module, it’s retrieved from a StoreClient object.
  2. For Android, it’s set in the AndroidRuntimeSettings configuration.
  3. For iOS, it’s retrieved from the App Store’s response.

Other variables that interact with StoreVersion include:

Developers should be aware of the following when using this variable:

  1. Its meaning and usage vary across different subsystems.
  2. For Android, it has a valid range of 1 to 2147483647.
  3. In the iOS context, it’s used for version comparison to determine if an update is available.

Best practices when using this variable:

  1. Keep it consistently updated across all relevant systems to maintain version coherence.
  2. For Android, use it in conjunction with StoreVersionOffsetArm64 when dealing with arm64 APKs.
  3. In the Insights module, handle cases where the version might be unknown.
  4. For iOS, ensure proper numeric comparison when checking for updates.
  5. Document the meaning and usage of StoreVersion in each context to avoid confusion.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEngine.ini:3054, section: [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Private/Insights/StoreService/StoreBrowser.cpp:177

Scope (from outer to inner):

file
namespace    Insights
function     void FStoreBrowser::UpdateTraces

Source code excerpt:

		{
			// Get the server version.
			FString StoreVersion;
			{
				FScopeLock StoreClientLock(&GetStoreClientCriticalSection());
				const auto VersionResult = StoreClient->GetVersion();

				if (VersionResult)
				{

#Loc: <Workspace>/Engine/Source/Developer/TraceInsights/Private/Insights/StoreService/StoreBrowser.cpp:190

Scope (from outer to inner):

file
namespace    Insights
function     void FStoreBrowser::UpdateTraces

Source code excerpt:

						VersionString << TEXT(" (") << VersionResult->GetConfiguration() << TEXT(")");
					}
					StoreVersion = VersionString.ToString();
				}
				else
				{
					StoreVersion = TEXT("Unknown");
				}
			}

			// Update settings.
			{
				FScopeLock Lock(&SettingsCriticalSection);
				SettingsChangeSerial++;
				Host = FInsightsManager::Get()->GetLastStoreHost();
				Version = StoreVersion;
			}
		}
	}

	// Check if the list of trace sessions or store settings have changed.
	{

#Loc: <Workspace>/Engine/Source/Runtime/Android/AndroidRuntimeSettings/Classes/AndroidRuntimeSettings.h:200

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	// The version number used to indicate newer versions in the Store
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging", Meta = (DisplayName = "Store Version (1-2147483647)", ClampMin="1", ClampMax="2147483647"))
	int32 StoreVersion;

	// Offset to add to store version for APKs generated for arm64
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging", meta = (DisplayName = "Store Version offset (arm64)"))
	int32 StoreVersionOffsetArm64;

	// Offset to add to store version for APKs generated for x86_64

#Loc: <Workspace>/Engine/Source/Runtime/ApplicationCore/Private/IOS/IOSAppDelegate.cpp:1254

Scope: file

Source code excerpt:

				{
					// get the store version
					NSString* StoreVersion = StoreDictionary[@"results"][0][@"version"];
					if ([StoreVersion compare: CurrentVersion options: NSNumericSearch] == NSOrderedDescending)
					{
						self.bUpdateAvailable = true;
					}
					else
					{
						self.bUpdateAvailable = false;

#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:949

				ConfigHierarchy Ini = GetConfigCacheIni(ConfigHierarchyType.Engine);
				int StoreVersion = 1;
				Ini.GetInt32("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "StoreVersion", out StoreVersion);

				bool bUseChangeListAsStoreVersion = false;
				Ini.GetBool("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "bUseChangeListAsStoreVersion", out bUseChangeListAsStoreVersion);

				bool IsBuildMachine = Unreal.IsBuildMachine();
				// override store version with changelist if enabled and is build machine

Location: <Workspace>/Engine/Source/Programs/UnrealBuildTool/ProjectFiles/VisualStudioCode/VSCodeProjectFileGenerator.cs:1195

			int StoreVersionArm64 = 1;
			int StoreVersionOffsetArm64 = 0;
			Ini.GetInt32("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "StoreVersion", out StoreVersion);
			Ini.GetInt32("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "StoreVersionOffsetArm64", out StoreVersionOffsetArm64);
			StoreVersionArm64 = StoreVersion + StoreVersionOffsetArm64;

			DirectoryReference SymbolPathArm64 = DirectoryReference.Combine(
				BuildProduct.OutputFile.Directory,
				Target.Name + "_Symbols_v" + StoreVersionArm64.ToString(),