UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
InstallBundleTypes.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
7#include "Containers/Map.h"
8#include "Containers/Set.h"
10#include "CoreMinimal.h"
11#include "Delegates/Delegate.h"
13#include "HAL/Platform.h"
15#include "Misc/DateTime.h"
16#include "Misc/EnumClassFlags.h"
17#include "Misc/EnumRange.h"
18#include "Misc/TVariant.h"
19#include "UObject/NameTypes.h"
20
21#if !defined(WITH_PLATFORM_INSTALL_BUNDLE_SOURCE)
22 #define WITH_PLATFORM_INSTALL_BUNDLE_SOURCE 0
23#endif
24
25enum class UE_DEPRECATED(5.5, "Use FInstallBundleSourceType") EInstallBundleSourceType : int
26{
27 Bulk,
30#if WITH_PLATFORM_INSTALL_BUNDLE_SOURCE
32#endif // WITH_PLATFORM_INSTALL_BUNDLE_SOURCE
35 Count,
36};
38ENUM_RANGE_BY_COUNT(EInstallBundleSourceType, EInstallBundleSourceType::Count);
39UE_DEPRECATED(5.5, "Use FInstallBundleSourceType")
44
45
47{
48private:
49 FStringView NameStr;
50
51public:
53
57
58 FStringView GetName() const { return NameStr; }
59 FString GetNameStr() const { return FString(NameStr); }
60 const TCHAR* GetNameCStr() const { return NameStr.GetData(); }
61
62 bool IsValid() const { return !NameStr.IsEmpty(); }
63
65 {
66 // These should always point to constant strings
67 return NameStr.GetData() == Other.NameStr.GetData();
68 }
69
71 {
72 // These should always point to constant strings
73 return PointerHash(In.NameStr.GetData());
74 }
75};
77
84
104
106{
109 UpToDate,
110 Count,
111};
113
122
129
131{
132 // Size remaining to download
134 // Size needed to install the remaining download under GamePersistentDownloadDir
136 // Size needed to install the remaining download under other directories than GamePersistentDownloadDir
138 // size of bundle currently on disk under GamePersistentDownloadDir
140 // size of bundle currently on disk under other directories than GamePersistentDownloadDir
142
144 {
146 Result.DownloadSize = DownloadSize + Other.DownloadSize;
147 Result.SpaceRequiredForInstall = SpaceRequiredForInstall + Other.SpaceRequiredForInstall;
148 Result.SpaceRequiredForInstallOtherDirs = SpaceRequiredForInstallOtherDirs + Other.SpaceRequiredForInstallOtherDirs;
149 Result.CurrentSizeOnDisk = CurrentSizeOnDisk + Other.CurrentSizeOnDisk;
150 Result.CurrentSizeOnDiskOtherDirs = CurrentSizeOnDiskOtherDirs + Other.CurrentSizeOnDiskOtherDirs;
151 return Result;
152 }
154 {
155 *this = *this + Other;
156 return *this;
157 }
158};
159
160// TODO: Create a per-source version of this struct so that its clear what data bundle sources
161// are responsible for populating.
163{
172
174 // Bundle Sources don't need to populate this, bundle manager can determine it from init data
177
178#if !UE_BUILD_SHIPPING
179 UE_DEPRECATED(5.6, "Please switch to using ContentSize")
181 UE_DEPRECATED(5.6, "Please switch to using ContentSize")
183 UE_DEPRECATED(5.6, "Please switch to using ContentSize")
185 UE_DEPRECATED(5.6, "Please switch to using ContentSize")
187#endif
188
191
192 UE_DEPRECATED(5.7, "Please switch to using ContentSize")
194
197};
198
200{
201 None = 0,
202 ForceNoPatching UE_DEPRECATED(5.7, "ForceNoPatching is no longer supported, use uninstall") = (1 << 0),
203 UpdateBundleReports = (1 << 1), // will update the BundleReport for the involved bundles (see InstallBundleManagerReporting.h and IInstallBundleManager::ReportingDelegate)
204};
206
208
210{
211 None = 0,
212 EnqueuedBundles = (1 << 0),
214 SkippedAlreadyUpdatedBundles = (1 << 2), // Only possible with EInstallBundleRequestFlags::SkipMount
216 SkippedAlreadyRemovedBundles = (1 << 4), // Only possible with EInstallBundleReleaseRequestFlags::RemoveFilesIfPossible
217 SkippedUnknownBundles = (1 << 5),
218 SkippedInvalidBundles = (1 << 6), // Bundle can't be used with this build
219 SkippedUnusableLanguageBundles = (1 << 7), // Can't enqueue language bundles because of current system settings
220 SkippedBundlesDueToBundleSource = (1 << 8), // A bundle source rejected a bundle for some reason
221};
223
241
242// TODO: Should probably be renamed to EInstallBundleRequestUpdateFlags
244{
245 None = 0,
246 CheckForCellularDataUsage = (1 << 0),
247 UseBackgroundDownloads UE_DEPRECATED(5.7, "UseBackgroundDownloads is no longer supported, done automatically") = (1 << 1),
249 ForceNoPatching UE_DEPRECATED(5.7, "ForceNoPatching is no longer supported, use uninstall") = (1 << 3),
251 SkipMount = (1 << 5),
252 AsyncMount = (1 << 6),
253 UpdateBundleReports = (1 << 7), // will update the BundleReport for the involved bundles (see InstallBundleManagerReporting.h and IInstallBundleManager::ReportingDelegate)
254 ExplicitUpdateList = (1 << 8),
255 Defaults = None,
256};
258
268
270{
271 None = 0,
272 RemoveFilesIfPossible = (1 << 0), // Bundle sources must support removal, and bundle must not be part of the source's cache
273 ExplicitRemoveList = (1 << 1), // Only attempt to remove explicitly supplied bundles instead of automatically removing dependencies
274 SkipReleaseUnmountOnly = (1 << 2), // Unmount but leave content referenced. The inverse of EInstallBundleRequestFlags::SkipMount
275};
277
279{
280 None = 0,
281 OnCellularNetwork = (1 << 0),
282 NoInternetConnection = (1 << 1),
283 UserPaused = (1 << 2)
284};
286
287enum class EInstallBundleStatus : int
288{
289 Requested,
290 Updating,
291 Finishing,
292 Ready,
293 Count,
294};
296
312
318{
319 High,
320 Normal,
321 Low,
322 Count
323};
326
332
334{
335 // Reserved for future use
336};
337
338// Bundle Info communicated from bundle source to bundle manager at any time
340{
344 uint64 FullInstallSize = 0; // Total disk footprint when this bundle is fully installed
345 uint64 InstallOverheadSize = 0; // Any additional space required to complete installation
346 FDateTime LastAccessTime = FDateTime::MinValue(); // If cached, used to decide eviction order
347 EInstallBundleInstallState BundleContentState = EInstallBundleInstallState::NotInstalled; // Whether this bundle is up to date
348 bool bIsCached = false; // Whether this bundle should be cached if this source has a bundle cache
349 bool bContainsIoStoreOnDemandToc = false; // Whether this bundle contains an an IoStoreOnDemand Toc
350};
351
356
357// Persisted Bundle Info communicated from bundle source to bundle manager on startup
359{
360 uint64 CurrentInstallSize = 0; // Disk footprint of the bundle in it's current state
361 bool bIsStartup = false; // Only one startup bundle allowed. All sources must agree on this.
362 bool bDoPatchCheck = false; // This bundle should do a patch check and fail if it doesn't pas
363};
364
369
380
381namespace UE::IoStore
382{
383 struct FOnDemandMountArgs;
384}
385
387{
392
395
396 // Forward any errors from the underlying implementation for a specific source
397 // Currently, these just forward BPT Error info
400
403 UE_DEPRECATED(5.6, "All shader libs are now packaged and avialable via UFS")
404 TSet<FString> NonUFSShaderLibPaths;
405 TArray<TUniquePtr<UE::IoStore::FOnDemandMountArgs>> OnDemandMountArgs;
406 FPakMountOptions MountOptions;
407 FString ProjectName;
408
409 uint64 CurrentInstallSize = 0;
410 FDateTime LastAccessTime = FDateTime::MinValue(); // If cached, used to decide eviction order
411
412 bool bContentWasInstalled = false; // If true, the source did work to update the content
413
414 bool DidBundleSourceDoWork() const { return (ContentPaths.Num() != 0);}
415};
416
418{
421
422 FDateTime LastAccessTime = FDateTime::MinValue(); // If cached, used to decide eviction order
423
424 // Indicates content was actually removed and bundle manager should consider
425 // this bundle as no longer installed.
426 bool bContentWasRemoved = false;
427};
428
429// Useful to store any kind of information about the build installer
431{
432 FName BundleName; // To known which Bundle this stat was for even after all the stats are aggregated
435};
436
438{
440
441 float BackgroundDownload_Percent = 0;
442 float InstallOnly_Percent = -1; // -1 means the value is not valid and Install_Percent should be used instead
443 float Install_Percent = 0; // Download and Install progress combined
444
445 TArray<FBuildInstallerStat> Stats; // Used for additional information about the install
446};
447
449{
452 // True if the bundle actually transitioned to/from paused,
453 // which is different than the flags changing
454 bool bDidPauseChange = false;
455};
456
458{
459 None = 0,
460 LanguageNotCurrent = (1 << 0), // The platform language must be changed to make it valid to request this bundle
461 NotValid = (1 << 1), // Bundle can't be used with this build
462};
464
466{
468 uint64 FullInstallSize = 0;
469 uint64 InstallOverheadSize = 0;
470 uint64 CurrentInstallSize = 0;
472 double AgeScalar = 1.0;
473 bool bReserved = false;
474};
475
477{
480 uint64 UsedSize = 0;
481 uint64 ReservedSize = 0;
482 uint64 FreeSize = 0;
483 // EInstallBundleCacheStatsFlags::DumpToResults must be used to populate BundleStats
485};
486
488{
489 None = 0,
490 DumpToLog = (1 << 0),
491 CSVFormat = (1 << 1),
492 DumpToResults = (1 << 2)
493};
495
496enum class UE_DEPRECATED(5.7, "Use EInstallBundleCacheStatsFlags") EInstallBundleCacheDumpToLog : int8
497{
498 None = 0,
499 Default,
500 CSV
501};
502
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
FPlatformTypes::uint64 uint64
A 64-bit unsigned integer.
Definition Platform.h:1117
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
#define ENUM_CLASS_FLAGS(Enum)
Definition EnumClassFlags.h:6
#define ENUM_RANGE_BY_COUNT(EnumType, Count)
Definition EnumRange.h:25
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
EInstallBundleReleaseRequestFlags
Definition InstallBundleTypes.h:270
EInstallBundleStatus
Definition InstallBundleTypes.h:288
EInstallBundlePauseFlags
Definition InstallBundleTypes.h:279
EInstallBundleSourceBundleSkipReason
Definition InstallBundleTypes.h:458
EInstallBundleManagerInitState
Definition InstallBundleTypes.h:79
EInstallBundleGetContentStateFlags
Definition InstallBundleTypes.h:200
EInstallBundleInstallState
Definition InstallBundleTypes.h:106
INSTALLBUNDLEMANAGER_API void LexFromString(EInstallBundleSourceType &OutType, const TCHAR *String)
Definition InstallBundleTypes.cpp:34
EInstallBundleManagerInitResult
Definition InstallBundleTypes.h:86
EInstallBundleReleaseResult
Definition InstallBundleTypes.h:260
EInstallBundleRequestFlags
Definition InstallBundleTypes.h:244
EInstallBundleSourceUpdateBundleInfoResult
Definition InstallBundleTypes.h:371
INSTALLBUNDLEMANAGER_API const TCHAR * LexToString(EInstallBundleSourceType Type)
Definition InstallBundleTypes.cpp:13
EInstallBundlePriority
Definition InstallBundleTypes.h:318
INSTALLBUNDLEMANAGER_API bool LexTryParseString(EInstallBundlePriority &OutMode, const TCHAR *InBuffer)
Definition InstallBundleTypes.cpp:240
EInstallBundleCacheStatsFlags
Definition InstallBundleTypes.h:488
EInstallBundleResult
Definition InstallBundleTypes.h:225
EInstallBundleManagerPatchCheckResult
Definition InstallBundleTypes.h:298
EInstallBundleRequestInfoFlags
Definition InstallBundleTypes.h:210
uint32 PointerHash(const void *Key)
Definition TypeHash.h:91
uint8_t uint8
Definition binka_ue_file_header.h:8
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition InstallBundleTypes.h:47
bool IsValid() const
Definition InstallBundleTypes.h:62
FString GetNameStr() const
Definition InstallBundleTypes.h:59
friend uint32 GetTypeHash(FInstallBundleSourceType In)
Definition InstallBundleTypes.h:70
PRAGMA_ENABLE_DEPRECATION_WARNINGS FStringView GetName() const
Definition InstallBundleTypes.h:58
bool operator==(const FInstallBundleSourceType Other) const
Definition InstallBundleTypes.h:64
const TCHAR * GetNameCStr() const
Definition InstallBundleTypes.h:60
Definition NameTypes.h:617
Definition Text.h:385
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
Definition UnrealString.h.inl:34
constexpr bool IsEmpty() const
Definition StringView.h:180
constexpr const CharType * GetData() const
Definition StringView.h:160
Definition UniquePtr.h:107
Definition TVariant.h:48
Definition BuildPatchFileConstructor.h:28
NO_LOGGING.
Definition Client.h:20
Definition AdvancedWidgetsModule.cpp:13
@ false
Definition radaudio_common.h:23
Definition InstallBundleTypes.h:431
FName StatName
Definition InstallBundleTypes.h:433
TVariant< bool, int32, int64, float, double, FString > StatValue
Definition InstallBundleTypes.h:434
FName BundleName
Definition InstallBundleTypes.h:432
Definition InstallBundleTypes.h:504
FString OldManifestVersion
Definition InstallBundleTypes.h:507
FString CurrentManifest
Definition InstallBundleTypes.h:506
FString InstallManifestVersion
Definition InstallBundleTypes.h:508
FString BPTErrorCode
Definition InstallBundleTypes.h:513
FString OldVersionTimeStamp
Definition InstallBundleTypes.h:509
uint64 EstimatedFullDownloadBytes
Definition InstallBundleTypes.h:511
uint64 TotalDownloadedBytes
Definition InstallBundleTypes.h:510
FString Result
Definition InstallBundleTypes.h:512
FString PreviousManifest
Definition InstallBundleTypes.h:505
Definition DateTime.h:76
static FDateTime MinValue()
Definition DateTime.h:668
Definition InstallBundleTypes.h:466
FName BundleName
Definition InstallBundleTypes.h:467
Definition InstallBundleTypes.h:477
FName CacheName
Definition InstallBundleTypes.h:478
TArray< FInstallBundleCacheBundleStats > BundleStats
Definition InstallBundleTypes.h:484
Definition InstallBundleTypes.h:163
PRAGMA_DISABLE_DEPRECATION_WARNINGS FInstallBundleCombinedContentState()=default
uint64 DownloadSize
Definition InstallBundleTypes.h:180
TSet< FName > BundlesWithIoStoreOnDemand
Definition InstallBundleTypes.h:175
INSTALLBUNDLEMANAGER_API bool GetAnyBundleHasState(EInstallBundleInstallState State, TArrayView< const FName > ExcludedBundles=TArrayView< const FName >()) const
Definition InstallBundleTypes.cpp:302
INSTALLBUNDLEMANAGER_API bool GetAllBundlesHaveState(EInstallBundleInstallState State, TArrayView< const FName > ExcludedBundles=TArrayView< const FName >()) const
Definition InstallBundleTypes.cpp:288
TMap< FInstallBundleSourceType, FString > CurrentVersion
Definition InstallBundleTypes.h:176
PRAGMA_ENABLE_DEPRECATION_WARNINGS TMap< FName, FInstallBundleContentState > IndividualBundleStates
Definition InstallBundleTypes.h:173
FInstallBundleCombinedContentState & operator=(const FInstallBundleCombinedContentState &)=default
FInstallBundleCombinedContentState(FInstallBundleCombinedContentState &&)=default
uint64 FreeSpace
Definition InstallBundleTypes.h:189
TOptional< FInstallBundleContentSize > BackgroundDownloadContentSize
Definition InstallBundleTypes.h:193
uint64 MaxDiskSpaceRequired
Definition InstallBundleTypes.h:186
FInstallBundleCombinedContentState(const FInstallBundleCombinedContentState &)=default
uint64 InstallOverheadSize
Definition InstallBundleTypes.h:184
uint64 InstallSize
Definition InstallBundleTypes.h:182
FInstallBundleContentSize ContentSize
Definition InstallBundleTypes.h:190
FInstallBundleCombinedContentState & operator=(FInstallBundleCombinedContentState &&)=default
Definition InstallBundleTypes.h:115
TMap< FName, EInstallBundleInstallState > IndividualBundleStates
Definition InstallBundleTypes.h:116
INSTALLBUNDLEMANAGER_API bool GetAnyBundleHasState(EInstallBundleInstallState State, TArrayView< const FName > ExcludedBundles=TArrayView< const FName >()) const
Definition InstallBundleTypes.cpp:274
INSTALLBUNDLEMANAGER_API bool GetAllBundlesHaveState(EInstallBundleInstallState State, TArrayView< const FName > ExcludedBundles=TArrayView< const FName >()) const
Definition InstallBundleTypes.cpp:260
TSet< FName > BundlesWithIoStoreOnDemand
Definition InstallBundleTypes.h:117
Definition InstallBundleTypes.h:131
uint64 DownloadSize
Definition InstallBundleTypes.h:133
FInstallBundleContentSize operator+(const FInstallBundleContentSize &Other) const
Definition InstallBundleTypes.h:143
uint64 SpaceRequiredForInstallOtherDirs
Definition InstallBundleTypes.h:137
uint64 CurrentSizeOnDisk
Definition InstallBundleTypes.h:139
uint64 SpaceRequiredForInstall
Definition InstallBundleTypes.h:135
uint64 CurrentSizeOnDiskOtherDirs
Definition InstallBundleTypes.h:141
FInstallBundleContentSize & operator+=(const FInstallBundleContentSize &Other)
Definition InstallBundleTypes.h:153
Definition InstallBundleTypes.h:124
float Weight
Definition InstallBundleTypes.h:126
EInstallBundleInstallState State
Definition InstallBundleTypes.h:125
TMap< FInstallBundleSourceType, FString > Version
Definition InstallBundleTypes.h:127
Definition InstallBundleTypes.h:334
Definition InstallBundleTypes.h:366
TMap< FName, FInstallBundleSourcePersistentBundleInfo > SourceBundleInfoMap
Definition InstallBundleTypes.h:367
Definition InstallBundleTypes.h:328
Definition InstallBundleTypes.h:449
FName BundleName
Definition InstallBundleTypes.h:450
Definition InstallBundleTypes.h:359
Definition InstallBundleTypes.h:438
FName BundleName
Definition InstallBundleTypes.h:439
TArray< FBuildInstallerStat > Stats
Definition InstallBundleTypes.h:445
Definition InstallBundleTypes.h:418
FName BundleName
Definition InstallBundleTypes.h:419
Definition InstallBundleTypes.h:353
TMap< FName, FInstallBundleSourceUpdateBundleInfo > SourceBundleInfoMap
Definition InstallBundleTypes.h:354
Definition InstallBundleTypes.h:340
FString BundleNameString
Definition InstallBundleTypes.h:342
FName BundleName
Definition InstallBundleTypes.h:341
Definition InstallBundleTypes.h:387
INSTALLBUNDLEMANAGER_API ~FInstallBundleSourceUpdateContentResultInfo()
FInstallBundleSourceUpdateContentResultInfo(const FInstallBundleSourceUpdateContentResultInfo &)=delete
FString OptionalErrorCode
Definition InstallBundleTypes.h:399
FText OptionalErrorText
Definition InstallBundleTypes.h:398
FName BundleName
Definition InstallBundleTypes.h:393
TArray< FString > ContentPaths
Definition InstallBundleTypes.h:401
TArray< FString > AdditionalRootDirs
Definition InstallBundleTypes.h:402
INSTALLBUNDLEMANAGER_API FInstallBundleSourceUpdateContentResultInfo()
INSTALLBUNDLEMANAGER_API FInstallBundleSourceUpdateContentResultInfo(FInstallBundleSourceUpdateContentResultInfo &&)
Definition GenericPlatformFile.h:1041
Definition Optional.h:131