UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IBuildInstaller.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 IBuildInstaller.h: Declares the IBuildInstaller interface.
5=============================================================================*/
6
7#pragma once
8
9#include "CoreMinimal.h"
10#include "BuildPatchState.h"
11#include "BuildPatchMessage.h"
12
13class IBuildInstaller;
14
18
23{
24 // There has been no registered error
25 NoError = 0,
26
27 // A download request failed and ran out of allowed retries
28 DownloadError = 1,
29
30 // A file failed to construct properly
32
33 // An error occurred trying to move the file to the install location
35
36 // The installed build failed to verify
38
39 // The user or some process has closed the application
41
42 // An application error, such as module fail to load.
44
45 // User canceled download
46 UserCanceled = 7,
47
48 // A prerequisites installer failed
50
51 // An initialization error
53
54 // An error occurred creating a file due to excessive path length
56
57 // An error occurred creating a file due to their not being enough space left on the disk
58 OutOfDiskSpace = 11,
59
60 // Used to help verify logic
62};
63
68{
69 static const TCHAR* ErrorTypeStrings[] =
70 {
71 TEXT("OK"), // NoError
72 TEXT("DL"), // DownloadError
73 TEXT("FC"), // FileConstructionFail
74 TEXT("MF"), // MoveFileToInstall
75 TEXT("BV"), // BuildVerifyFail
76 TEXT("SD"), // ApplicationClosing
77 TEXT("FA"), // ApplicationError
78 TEXT("UC"), // UserCanceled
79 TEXT("PQ"), // PrerequisiteError
80 TEXT("IZ"), // InitializationError
81 TEXT("PL"), // PathLengthExceeded
82 TEXT("DS"), // OutOfDiskSpace
83 };
84};
85
86// Enum describing download health. The actual percentage values used are configurable in the engine ini.
88{
89 // All requests are in the retrying state. No progress currently. Possibly disconnected.
90 Disconnected = 0,
91 // More than 10% of requests are failing.
92 Poor,
93 // 10% or fewer requests are failing.
94 OK,
95 // 1% or fewer requests are failing.
96 Good,
97 // No requests are failing.
99
100 // Must be last value, only used for value counts.
102};
103
108{
109 // Constructor
111 : NumFilesInBuild(0)
122 , NumBadDownloads(0)
131 , PeakDownloadSpeed(0.0)
132 , FinalDownloadSpeed(-1.0)
134 , TotalReadData(0)
136 , PeakDiskReadSpeed(0.0)
139 , PeakDiskWriteSpeed(0.0)
141 , InitializeTime(0.0f)
142 , ConstructTime(0.0f)
143 , MoveFromStageTime(0.0f)
144 , FileAttributesTime(0.0f)
145 , VerifyTime(0.0f)
146 , CleanUpTime(0.0f)
147 , PrereqTime(0.0f)
148 , ProcessPausedTime(0.0f)
149 , ProcessActiveTime(0.0f)
150 , ProcessExecuteTime(0.0f)
155 , ErrorCode()
158 , FinalProgress(0.0f)
167 {}
168
169 // The total number of files in the build.
171 // The total number of files outdated.
173 // The total number of files in the previous build that can be deleted.
175 // The total number of chunks making up those files.
177 // The number of required chunks queued for download.
179 // The number of chunks locally available in the build.
181 // The number of chunks available in chunkdb files.
183 // The total number of chunks that were downloaded.
185 // The number of chunks successfully recycled.
187 // The number of chunks successfully read from chunkdbs.
189 // The number of chunks we did not successfully receive.
191 // The number of chunks we received but were determined bad data.
193 // The number of chunks we aborted as they were determined as taking too long.
195 // The number of chunks that failed to be recycled from existing build.
197 // The number of chunks that had to be loaded from the drive store.
199 // The number of chunks that failed to load from the drive store.
201 // The max disk space used by the drive store
203 // The number of chunks that were lost due to drive space limits
205 // The number of chunks that were not successfully loaded from provided chunkdbs.
207 // The total number of bytes downloaded.
209 // The peak number of simultaneous download requests
211 // The average chunk download speed.
213 // The peak chunk download speed.
215 // The download speed registered at the end of the installation.
217 // The theoretical download time (data/speed).
219 // The total number of bytes read to disk.
221 // The average disk read speed.
223 // The peak disk read speed.
225 // The total number of bytes written to disk.
227 // The average disk write speed.
229 // The peak disk write speed.
231 // The total number of files constructed.
233
234 // We don't actually do any installation when requesting this value, we just start up an installer, compute it, then bail. See
235 // bCalculateDeleteChunkDbMaxDiskSpaceAndExit in the installer configuration. Will be zero all other times.
237
238 // The time spent during the initialization stage.
240 // The time spent during the construction stage.
242 // The time spent moving staged files into the installation location.
244 // The time spent during the file attribution stage.
246 // The time spent during the verification stage.
248 // The time spent during the clean up stage.
250 // The time spent during the prerequisite stage.
252 // The amount of time that was spent paused.
254 // The amount of time that was spent active (un-paused).
256 // The total time that the install process took to complete.
258 // Whether the process was successful.
260 // The number of times the system looped to retry.
262 // The failure type for the install.
264 // If NumInstallRetries > 0, this will contain the list of retry reasons for retrying.
266 // The error code. No error results in 'OK'.
267 FString ErrorCode;
268 // If NumInstallRetries > 0, this will contain the list of error codes for each retry.
270 // The localized, more generic failure reason.
272 // Final progress state, this is the progress of the current retry attempt.
274 // The overall rate of success for download requests.
276 // The amount of time that was spent with Excellent download health.
278 // The amount of time that was spent with Good download health.
280 // The amount of time that was spent with OK download health.
282 // The amount of time that was spent with Poor download health.
284 // The amount of time that was spent with Disconnected download health.
286 // Max memory usage for the memory store.
288 // Memory limit for the memory backing store
290 // The total number of bytes required to start the installation.
292 // The total number of bytes available at the time of checking ProcessRequiredDiskSpace.
294};
295
296namespace BuildPatchServices
297{
298 struct FBuildInstallerConfiguration;
299}
300
305{
306public:
310 virtual ~IBuildInstaller() { }
311
316 virtual bool StartInstallation() = 0;
317
322 virtual bool IsComplete() const = 0;
323
328 virtual bool IsCanceled() const = 0;
329
334 virtual bool IsPaused() const = 0;
335
340 virtual bool IsResumable() const = 0;
341
346 virtual bool IsUpdate() const = 0;
347
352 virtual bool CompletedSuccessfully() const = 0;
353
358 virtual bool HasError() const = 0;
359
365
366 UE_DEPRECATED(4.21, "GetPercentageText has been deprecated. It will no longer be supported in the future.")
368
369 UE_DEPRECATED(4.21, "GetDownloadSpeedText has been deprecated. It will no longer be supported in the future.")
371
376 virtual double GetDownloadSpeed() const = 0;
377
378 UE_DEPRECATED(4.21, "GetInitialDownloadSize has been deprecated. Please use GetTotalDownloadRequired instead.")
380
385 virtual int64 GetTotalDownloadRequired() const = 0;
386
391 virtual int64 GetTotalDownloaded() const = 0;
392
397 virtual BuildPatchServices::EBuildPatchState GetState() const = 0;
398
399 UE_DEPRECATED(4.21, "GetStatusText has been deprecated. It will no longer be supported in the future.")
401
406 virtual float GetUpdateProgress() const = 0;
407
413
419
425
431 virtual FString GetErrorCode() const = 0;
432
437
443
448 virtual void RegisterMessageHandler(BuildPatchServices::FMessageHandler* MessageHandler) = 0;
449
454 virtual void UnregisterMessageHandler(BuildPatchServices::FMessageHandler* MessageHandler) = 0;
455
461 virtual const BuildPatchServices::FBuildInstallerConfiguration& GetConfiguration() const = 0;
462
463#if !UE_BUILD_SHIPPING
468#endif
469
476};
477
478static_assert((uint32)EBuildPatchInstallError::NumInstallErrors == 12, "Please add support for the extra values to the Lex functions below.");
479
481{
482#define CASE_ENUM_TO_STR(Value) case EBuildPatchInstallError::Value: return TEXT(#Value)
483 switch (Error)
484 {
497 default: return TEXT("InvalidOrMax");
498 }
499#undef CASE_ENUM_TO_STR
500}
501
503{
504#define RETURN_IF_EQUAL(Value) if (FCString::Stricmp(Buffer, TEXT(#Value)) == 0) { Error = EBuildPatchInstallError::Value; return; }
505 const TCHAR* const Prefix = TEXT("EBuildPatchInstallError::");
506 const SIZE_T PrefixLen = FCString::Strlen(Prefix);
507 if (FCString::Strnicmp(Buffer, Prefix, PrefixLen) == 0)
508 {
509 Buffer += PrefixLen;
510 }
523 // Did not match
525 return;
526#undef RETURN_IF_EQUAL
527}
528
529static_assert((uint32)EBuildPatchDownloadHealth::NUM_Values == 5, "Please add support for the extra values to the Lex functions below.");
530
532{
533#define CASE_ENUM_TO_STR(Value) case EBuildPatchDownloadHealth::Value: return TEXT(#Value)
534 switch (Error)
535 {
541 default: return TEXT("InvalidOrMax");
542 }
543#undef CASE_ENUM_TO_STR
544}
545
547{
548#define RETURN_IF_EQUAL(Value) if (FCString::Stricmp(Buffer, TEXT(#Value)) == 0) { Error = EBuildPatchDownloadHealth::Value; return; }
549 const TCHAR* const Prefix = TEXT("EBuildPatchDownloadHealth::");
550 const SIZE_T PrefixLen = FCString::Strlen(Prefix);
551 if (FCString::Strnicmp(Buffer, Prefix, PrefixLen) == 0)
552 {
553 Buffer += PrefixLen;
554 }
560 // Did not match
562 return;
563#undef RETURN_IF_EQUAL
564}
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::SIZE_T SIZE_T
An unsigned integer the same size as a pointer, the same as UPTRINT.
Definition Platform.h:1150
FPlatformTypes::TCHAR TCHAR
Either ANSICHAR or WIDECHAR, depending on whether the platform supports wide characters or the requir...
Definition Platform.h:1135
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
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
TWeakPtr< IBuildInstaller, ESPMode::ThreadSafe > IBuildInstallerWeakPtr
Definition IBuildInstaller.h:17
EBuildPatchInstallError
Definition IBuildInstaller.h:23
const TCHAR * LexToString(EBuildPatchInstallError Error)
Definition IBuildInstaller.h:480
#define CASE_ENUM_TO_STR(Value)
#define RETURN_IF_EQUAL(Value)
TSharedRef< IBuildInstaller, ESPMode::ThreadSafe > IBuildInstallerRef
Definition IBuildInstaller.h:16
EBuildPatchDownloadHealth
Definition IBuildInstaller.h:88
void LexFromString(EBuildPatchInstallError &Error, const TCHAR *Buffer)
Definition IBuildInstaller.h:502
TSharedPtr< IBuildInstaller, ESPMode::ThreadSafe > IBuildInstallerPtr
Definition IBuildInstaller.h:15
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition UnrealType.h:3087
Definition Text.h:385
Definition IBuildInstaller.h:305
virtual BuildPatchServices::EBuildPatchState GetState() const =0
virtual bool TogglePauseInstall()=0
virtual bool IsCanceled() const =0
virtual float GetUpdateProgress() const =0
virtual EBuildPatchDownloadHealth GetDownloadHealth() const =0
virtual bool IsPaused() const =0
virtual void UnregisterMessageHandler(BuildPatchServices::FMessageHandler *MessageHandler)=0
virtual bool IsResumable() const =0
virtual int64 GetTotalDownloaded() const =0
virtual const BuildPatchServices::FBuildInstallerConfiguration & GetConfiguration() const =0
virtual FText GetPercentageText() const =0
virtual TMap< FString, TArray64< uint8 > > & GetFilesInstalledToMemory()=0
virtual ~IBuildInstaller()
Definition IBuildInstaller.h:310
virtual int64 GetTotalDownloadRequired() const =0
virtual EBuildPatchInstallError GetErrorType() const =0
virtual FText GetDownloadSpeedText() const =0
virtual bool StartInstallation()=0
virtual double GetDownloadSpeed() const =0
virtual bool HasError() const =0
virtual void GetDebugText(TArray< FString > &Output)
Definition IBuildInstaller.h:467
virtual FText GetErrorText() const =0
virtual FText GetStatusText() const =0
virtual bool IsUpdate() const =0
virtual FBuildInstallStats GetBuildStatistics() const =0
virtual void RegisterMessageHandler(BuildPatchServices::FMessageHandler *MessageHandler)=0
virtual void CancelInstall()=0
virtual int64 GetInitialDownloadSize() const
Definition IBuildInstaller.h:379
virtual bool CompletedSuccessfully() const =0
virtual bool IsComplete() const =0
virtual FString GetErrorCode() const =0
Definition Array.h:670
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition BuildPatchFileConstructor.h:28
Definition IBuildInstaller.h:68
@ false
Definition radaudio_common.h:23
Definition IBuildInstaller.h:108
float DisconnectedDownloadHealthTime
Definition IBuildInstaller.h:285
uint32 NumChunksRecycled
Definition IBuildInstaller.h:186
uint32 NumInstallRetries
Definition IBuildInstaller.h:261
uint32 NumFilesOutdated
Definition IBuildInstaller.h:172
uint64 ProcessRequiredDiskSpace
Definition IBuildInstaller.h:291
float ProcessExecuteTime
Definition IBuildInstaller.h:257
uint64 MemoryStoreSizeLimitBytes
Definition IBuildInstaller.h:289
uint32 NumDriveStoreLoadFailures
Definition IBuildInstaller.h:200
FText FailureReasonText
Definition IBuildInstaller.h:271
double FinalDownloadSpeed
Definition IBuildInstaller.h:216
uint32 NumFilesToRemove
Definition IBuildInstaller.h:174
double AverageDiskWriteSpeed
Definition IBuildInstaller.h:228
uint32 ChunksInChunkDbs
Definition IBuildInstaller.h:182
double PeakDownloadSpeed
Definition IBuildInstaller.h:214
float FinalProgress
Definition IBuildInstaller.h:273
float ProcessPausedTime
Definition IBuildInstaller.h:253
uint64 TotalWrittenData
Definition IBuildInstaller.h:226
uint32 NumFilesConstructed
Definition IBuildInstaller.h:232
float InitializeTime
Definition IBuildInstaller.h:239
EBuildPatchInstallError FailureType
Definition IBuildInstaller.h:263
double AverageDownloadSpeed
Definition IBuildInstaller.h:212
uint32 NumBadDownloads
Definition IBuildInstaller.h:192
uint64 TotalReadData
Definition IBuildInstaller.h:220
uint64 ProcessAvailableDiskSpace
Definition IBuildInstaller.h:293
float CleanUpTime
Definition IBuildInstaller.h:249
float GoodDownloadHealthTime
Definition IBuildInstaller.h:279
double PeakDiskReadSpeed
Definition IBuildInstaller.h:224
uint32 ActiveRequestCountPeak
Definition IBuildInstaller.h:210
uint64 TotalDownloadedData
Definition IBuildInstaller.h:208
FBuildInstallStats()
Definition IBuildInstaller.h:110
TArray< FString > RetryErrorCodes
Definition IBuildInstaller.h:269
TArray< EBuildPatchInstallError > RetryFailureTypes
Definition IBuildInstaller.h:265
uint32 NumChunksRequired
Definition IBuildInstaller.h:176
uint32 NumRecycleFailures
Definition IBuildInstaller.h:196
uint64 MemoryStoreSizePeakBytes
Definition IBuildInstaller.h:287
uint32 NumDriveStoreChunkLoads
Definition IBuildInstaller.h:198
float ProcessActiveTime
Definition IBuildInstaller.h:255
float TheoreticalDownloadTime
Definition IBuildInstaller.h:218
uint32 NumChunkDbChunksFailed
Definition IBuildInstaller.h:206
uint32 ChunksQueuedForDownload
Definition IBuildInstaller.h:178
FString ErrorCode
Definition IBuildInstaller.h:267
float PoorDownloadHealthTime
Definition IBuildInstaller.h:283
float ExcellentDownloadHealthTime
Definition IBuildInstaller.h:277
uint32 NumDriveStoreLostChunks
Definition IBuildInstaller.h:204
uint32 NumAbortedDownloads
Definition IBuildInstaller.h:194
double AverageDiskReadSpeed
Definition IBuildInstaller.h:222
float MoveFromStageTime
Definition IBuildInstaller.h:243
float PrereqTime
Definition IBuildInstaller.h:251
uint32 NumFilesInBuild
Definition IBuildInstaller.h:170
float OverallRequestSuccessRate
Definition IBuildInstaller.h:275
uint64 MaxDiskSpaceNeededWhenDeletingChunkDbsIfRequested
Definition IBuildInstaller.h:236
uint32 NumFailedDownloads
Definition IBuildInstaller.h:190
float ConstructTime
Definition IBuildInstaller.h:241
float OkDownloadHealthTime
Definition IBuildInstaller.h:281
double PeakDiskWriteSpeed
Definition IBuildInstaller.h:230
uint32 NumChunksReadFromChunkDbs
Definition IBuildInstaller.h:188
float FileAttributesTime
Definition IBuildInstaller.h:245
float VerifyTime
Definition IBuildInstaller.h:247
uint32 NumChunksDownloaded
Definition IBuildInstaller.h:184
uint32 DriveStorePeakBytes
Definition IBuildInstaller.h:202
uint32 ChunksLocallyAvailable
Definition IBuildInstaller.h:180
bool ProcessSuccess
Definition IBuildInstaller.h:259
static int32 Strlen(const CharType *String)
Definition CString.h:1047
static UE_FORCEINLINE_HINT int32 Strnicmp(const CharType *String1, const CharType *String2, SIZE_T Count)
Definition CString.h:1036