1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Determine update channel during update service initialize

This commit is contained in:
Robert 2023-03-06 22:21:40 +01:00
parent 5f206436c3
commit 148eb99870

View File

@ -45,12 +45,6 @@ public class UpdateService : IUpdateService
_updateNotificationProvider = updateNotificationProvider;
_getReleaseInstaller = getReleaseInstaller;
string? channelArgument = Constants.StartupArguments.FirstOrDefault(a => a.StartsWith("--channel="));
if (channelArgument != null)
Channel = channelArgument.Split("=")[1];
if (string.IsNullOrWhiteSpace(Channel))
Channel = "master";
if (OperatingSystem.IsWindows())
_updatePlatform = Platform.Windows;
else if (OperatingSystem.IsLinux())
@ -124,7 +118,7 @@ public class UpdateService : IUpdateService
}
/// <inheritdoc />
public string Channel { get; }
public string Channel { get; private set; } = "master";
/// <inheritdoc />
public string? PreviousVersion { get; private set; }
@ -190,6 +184,12 @@ public class UpdateService : IUpdateService
/// <inheritdoc />
public bool Initialize()
{
string? channelArgument = Constants.StartupArguments.FirstOrDefault(a => a.StartsWith("--channel="));
if (channelArgument != null)
Channel = channelArgument.Split("=")[1];
if (string.IsNullOrWhiteSpace(Channel))
Channel = "master";
// There should never be an installing folder
if (Directory.Exists(Path.Combine(Constants.UpdatingFolder, "installing")))
{