mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Determine update channel during update service initialize
This commit is contained in:
parent
5f206436c3
commit
148eb99870
@ -45,12 +45,6 @@ public class UpdateService : IUpdateService
|
|||||||
_updateNotificationProvider = updateNotificationProvider;
|
_updateNotificationProvider = updateNotificationProvider;
|
||||||
_getReleaseInstaller = getReleaseInstaller;
|
_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())
|
if (OperatingSystem.IsWindows())
|
||||||
_updatePlatform = Platform.Windows;
|
_updatePlatform = Platform.Windows;
|
||||||
else if (OperatingSystem.IsLinux())
|
else if (OperatingSystem.IsLinux())
|
||||||
@ -124,7 +118,7 @@ public class UpdateService : IUpdateService
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string Channel { get; }
|
public string Channel { get; private set; } = "master";
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public string? PreviousVersion { get; private set; }
|
public string? PreviousVersion { get; private set; }
|
||||||
@ -190,6 +184,12 @@ public class UpdateService : IUpdateService
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public bool Initialize()
|
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
|
// There should never be an installing folder
|
||||||
if (Directory.Exists(Path.Combine(Constants.UpdatingFolder, "installing")))
|
if (Directory.Exists(Path.Combine(Constants.UpdatingFolder, "installing")))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user