mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Update built-in plugins by build date not by version
This commit is contained in:
parent
a2e20b3821
commit
d8390d306c
@ -81,7 +81,7 @@ public static class Constants
|
||||
/// </summary>
|
||||
public static readonly PluginInfo CorePluginInfo = new()
|
||||
{
|
||||
Guid = Guid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff"), Name = "Artemis Core", Version = new Version(2, 0)
|
||||
Guid = Guid.Parse("ffffffff-ffff-ffff-ffff-ffffffffffff"), Name = "Artemis Core", Version = CurrentVersion
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -25,7 +25,7 @@ public class PluginInfo : CorePropertyChanged, IPrerequisitesSubject
|
||||
private Plugin _plugin = null!;
|
||||
private Uri? _repository;
|
||||
private bool _requiresAdmin;
|
||||
private Version _version = null!;
|
||||
private string _version = null!;
|
||||
private Uri? _website;
|
||||
|
||||
internal PluginInfo()
|
||||
@ -107,7 +107,7 @@ public class PluginInfo : CorePropertyChanged, IPrerequisitesSubject
|
||||
/// The version of the plugin
|
||||
/// </summary>
|
||||
[JsonProperty(Required = Required.Always)]
|
||||
public Version Version
|
||||
public string Version
|
||||
{
|
||||
get => _version;
|
||||
internal set => SetAndNotify(ref _version, value);
|
||||
|
||||
@ -137,27 +137,13 @@ internal class PluginManagementService : IPluginManagementService
|
||||
_logger.Debug("Copying missing built-in plugin {builtInPluginInfo}", builtInPluginInfo);
|
||||
CopyBuiltInPlugin(archive, preferred);
|
||||
}
|
||||
else
|
||||
else if (metaDataFileEntry.LastWriteTime > File.GetLastWriteTime(metadataFile))
|
||||
{
|
||||
PluginInfo pluginInfo;
|
||||
try
|
||||
{
|
||||
// Compare versions, copy if the same when debugging
|
||||
pluginInfo = CoreJson.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile))!;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArtemisPluginException($"Failed read plugin metadata needed to install built-in plugin: {e.Message}", e);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (builtInPluginInfo.Version > pluginInfo.Version)
|
||||
{
|
||||
_logger.Debug("Copying updated built-in plugin from {pluginInfo} to {builtInPluginInfo}", pluginInfo, builtInPluginInfo);
|
||||
_logger.Debug("Copying updated built-in plugin {builtInPluginInfo}", builtInPluginInfo);
|
||||
CopyBuiltInPlugin(archive, preferred);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new ArtemisPluginException($"Failed to install built-in plugin: {e.Message}", e);
|
||||
|
||||
@ -89,7 +89,7 @@ public class UpdateService : IUpdateService
|
||||
}
|
||||
}
|
||||
|
||||
// if (updated)
|
||||
if (updated)
|
||||
_updateNotificationProvider.Value.ShowInstalledNotification(currentVersion);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user