3using System.Threading.Tasks;
5using Microsoft.Extensions.Logging;
29 protected ILogger<EngineInstallerBase>
Logger {
get; }
38 IOManager = ioManager ??
throw new ArgumentNullException(nameof(ioManager));
39 Logger = logger ??
throw new ArgumentNullException(nameof(logger));
43 public abstract ValueTask<IEngineInstallation>
GetInstallation(
EngineVersion version,
string path, Task installationTask, CancellationToken cancellationToken);
46 public abstract Task
CleanCache(CancellationToken cancellationToken);
49 public async ValueTask<IEngineInstallation>
Install(
EngineVersion version,
string path,
bool deploymentPipelineProcesses, CancellationToken cancellationToken)
52 ArgumentNullException.ThrowIfNull(path);
54 await
InstallImpl(version, path, deploymentPipelineProcesses, cancellationToken);
56 return await
GetInstallation(version, path, Task.CompletedTask, cancellationToken);
74 ArgumentNullException.ThrowIfNull(version);
76 throw new InvalidOperationException($
"Non-{TargetEngineType} engine specified: {version.Engine.Value}");
87 protected abstract ValueTask
InstallImpl(
EngineVersion version,
string path,
bool deploymentPipelineProcesses, CancellationToken cancellationToken);
Information about an engine installation.
EngineType? Engine
The EngineType.
async ValueTask< IEngineInstallation > Install(EngineVersion version, string path, bool deploymentPipelineProcesses, CancellationToken cancellationToken)
Does actions necessary to get an extracted installation working.A ValueTask<TResult> resulting in the...
ValueTask TrustDmbPath(EngineVersion version, string fullDmbPath, CancellationToken cancellationToken)
Add a given fullDmbPath to the trusted DMBs list in BYOND's config.A ValueTask representing the runn...
ValueTask UpgradeInstallation(EngineVersion version, string path, CancellationToken cancellationToken)
Does actions necessary to get upgrade a version installed by a previous version of TGS....
EngineType TargetEngineType
The EngineType the installer supports.
Task CleanCache(CancellationToken cancellationToken)
Attempts to cleans the engine's cache folder for the system.A Task representing the running operation...
void CheckVersionValidity(EngineVersion version)
Check that a given version is of type EngineType.Byond.
ValueTask InstallImpl(EngineVersion version, string path, bool deploymentPipelineProcesses, CancellationToken cancellationToken)
Does actions necessary to get an extracted installation working.
ValueTask< IEngineInstallation > GetInstallation(EngineVersion version, string path, Task installationTask, CancellationToken cancellationToken)
Creates an IEngineInstallation for a given version .A ValueTask<TResult> resulting in a new IEngineIn...
IIOManager IOManager
Gets the IIOManager for the EngineInstallerBase.
EngineInstallerBase(IIOManager ioManager, ILogger< EngineInstallerBase > logger)
Initializes a new instance of the EngineInstallerBase class.
ILogger< EngineInstallerBase > Logger
Gets the ILogger for the EngineInstallerBase.
ValueTask< IEngineInstallationData > DownloadVersion(EngineVersion version, JobProgressReporter jobProgressReporter, CancellationToken cancellationToken)
Download a given engine version .A ValueTask<TResult> resulting in the IEngineInstallationData for th...
Progress reporter for a Job.
For downloading and installing game engines for a given system.
Interface for using filesystems.
EngineType
The type of engine the codebase is using.