InstallLocation

InstallLocation

#Overview

name: InstallLocation

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 7 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 InstallLocation is to specify the preferred installation location for an Android application when packaging it as an APK. This setting is part of the Android runtime settings in Unreal Engine 5.

This setting variable is primarily used by the Android-specific module of Unreal Engine, specifically within the AndroidRuntimeSettings system. It is defined in the UAndroidRuntimeSettings class, which is responsible for managing various Android-related configuration options.

The value of this variable is set through the Unreal Engine Editor’s project settings interface, under the “Android” category and “APK Packaging” subcategory. It is stored in the project’s configuration files.

InstallLocation interacts with other Android packaging settings, such as bEnableLint and options related to APK file generation. It is of type EAndroidInstallLocation::Type, which suggests it’s an enumeration with predefined values for different installation location options.

Developers must be aware that:

  1. This setting affects where the app will be installed on Android devices.
  2. Different installation locations may have implications for app performance, storage availability, and user experience.
  3. Some app stores or devices may have specific requirements or limitations regarding installation locations.

Best practices when using this variable include:

  1. Consider the size of your application and the target devices when choosing the installation location.
  2. Be aware of the implications of each installation location option on different Android devices and versions.
  3. Test your application with different installation location settings to ensure compatibility and optimal performance across various devices.
  4. Keep in mind that some installation locations may not be available on all devices, so have a fallback strategy.
  5. Align your choice with the guidelines of the app stores where you plan to distribute your application.

#Setting Variables

#References In INI files

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

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Plugins/Developer/CLionSourceCodeAccess/Source/CLionSourceCodeAccess/Private/CLionSourceCodeAccessor.cpp:227

Scope (from outer to inner):

file
function     FString FCLionSourceCodeAccessor::FindExecutablePath

Source code excerpt:

				if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid())
				{
					FString InstallLocation;
					if (JsonObject->TryGetStringField(TEXT("install_location"), InstallLocation))
					{
						if (!InstallLocation.IsEmpty())
						{
							ToolboxPath = InstallLocation;
						}
					}
				}
			}

			FString CLionHome = FPaths::Combine(ToolboxPath, FString("apps"), FString("CLion"));

#Loc: <Workspace>/Engine/Plugins/Developer/RiderSourceCodeAccess/Source/RiderSourceCodeAccess/Private/RiderPathLocator/Common/RiderPathLocator.cpp:20

Scope (from outer to inner):

file
function     FString ExtractPathFromSettingsJson

Source code excerpt:

		if (FJsonSerializer::Deserialize(JsonReader, JsonObject) && JsonObject.IsValid())
		{
			FString InstallLocation;
			if (JsonObject->TryGetStringField(TEXT("install_location"), InstallLocation))
			{
				if (!InstallLocation.IsEmpty())
				{
					return InstallLocation;
				}
			}
		}
	}
	return {};
}

#Loc: <Workspace>/Engine/Plugins/Developer/RiderSourceCodeAccess/Source/RiderSourceCodeAccess/Private/RiderPathLocator/Win/RiderPathLocatorWin.cpp:134

Scope (from outer to inner):

file
function     static TArray<FInstallInfo> CollectPathsFromRegistry

Source code excerpt:

		{
			if (Value != TEXT("InstallLocation")) continue;
			FString InstallLocation;
			if (GetStringRegKey(SubKey, Value, InstallLocation) != ERROR_SUCCESS) continue;
			
			const FString ExePath = FPaths::Combine(InstallLocation, TEXT("bin"), TEXT("rider64.exe"));
			TOptional<FInstallInfo> InstallInfo = FRiderPathLocator::GetInstallInfoFromRiderPath(ExePath, FInstallInfo::EInstallType::Installed);
			if(InstallInfo.IsSet())
			{
				InstallInfos.Add(InstallInfo.GetValue());
			}
		}

#Loc: <Workspace>/Engine/Plugins/Developer/RiderSourceCodeAccess/Source/RiderSourceCodeAccess/Private/RiderPathLocator/Win/RiderPathLocatorWin.cpp:172

Scope (from outer to inner):

file
function     static TArray<FInstallInfo> CollectDotUltimatePathsFromRegistry

Source code excerpt:

			if (Value != TEXT("InstallDir")) continue;
			
			FString InstallLocation;
			if (GetStringRegKey(SubKey, Value, InstallLocation) != ERROR_SUCCESS) continue;
			
			const FString ExePath = FPaths::Combine(InstallLocation, TEXT("bin"), TEXT("rider64.exe"));
			TOptional<FInstallInfo> InstallInfo = FRiderPathLocator::GetInstallInfoFromRiderPath(ExePath, FInstallInfo::EInstallType::Installed);
			if(InstallInfo.IsSet())
			{
				InstallInfos.Add(InstallInfo.GetValue());
			}
		}

#Loc: <Workspace>/Engine/Source/Developer/DesktopPlatform/Private/DesktopPlatformBase.cpp:1384

Scope (from outer to inner):

file
function     void FDesktopPlatformBase::ReadLauncherInstallationList

Source code excerpt:


					FString AppName = InstallationItem->GetStringField(TEXT("AppName"));
					FString InstallLocation = InstallationItem->GetStringField(TEXT("InstallLocation"));
					if(AppName.Len() > 0 && InstallLocation.Len() > 0)
					{
						FPaths::NormalizeDirectoryName(InstallLocation);
						LauncherInstallationList.Add(AppName, InstallLocation);
					}
				}
			}
			LauncherInstallationTimestamp = NewListTimestamp;
		}
	}

#Loc: <Workspace>/Engine/Source/Developer/DesktopPlatform/Private/DesktopPlatformBase.cpp:1411

Scope (from outer to inner):

file
function     void FDesktopPlatformBase::CheckForLauncherEngineInstallation

Source code excerpt:

			if (CustomFieldsObject.IsValid())
			{
				FString InstallLocation = CustomFieldsObject->GetStringField(TEXT("InstallLocation"));
				if (InstallLocation.Len() > 0)
				{
					OutInstallations.Add(Identifier, InstallLocation);
				}
			}
		}
	}
}

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

Scope (from outer to inner):

file
class        class UAndroidRuntimeSettings : public UObject

Source code excerpt:

	// Preferred install location for the application
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging")
	TEnumAsByte<EAndroidInstallLocation::Type> InstallLocation;

	// Enable -Xlint:unchecked and -Xlint:depreciation for Java compiling (Gradle only)
	UPROPERTY(GlobalConfig, EditAnywhere, Category = "APK Packaging", Meta = (DisplayName = "Enable Lint depreciation checks"))
	bool bEnableLint;

	// Should the data be placed into the .apk file instead of a separate .obb file. Amazon requires this to be enabled, but Google Play Store will not allow .apk files larger than 100MB, so only small games will work with this enabled.

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


			string InstallLocation;
			Ini.GetString("/Script/AndroidRuntimeSettings.AndroidRuntimeSettings", "InstallLocation", out InstallLocation);
			switch (InstallLocation.ToLower())
			{
				case "preferexternal":
					InstallLocation = "preferExternal";
					break;
				case "auto":