diff --git a/src/Artemis.Core/Plugins/PluginInfo.cs b/src/Artemis.Core/Plugins/PluginInfo.cs
index 279ea6c43..1d70aa0b8 100644
--- a/src/Artemis.Core/Plugins/PluginInfo.cs
+++ b/src/Artemis.Core/Plugins/PluginInfo.cs
@@ -113,7 +113,8 @@ public class PluginInfo : IPrerequisitesSubject
///
/// Gets the minimum version of Artemis required by this plugin
///
- public Version? MinimumVersion { get; internal init; } = new(1, 0, 0);
+ [JsonInclude]
+ public Version? MinimumVersion { get; internal init; }
///
/// Gets the plugin this info is associated with
diff --git a/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs b/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs
index 15756d2a0..f68bba209 100644
--- a/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs
+++ b/src/Artemis.UI.Shared/Services/Interfaces/IWindowService.cs
@@ -29,7 +29,8 @@ public interface IWindowService : IArtemisSharedUIService
///
/// The title of the dialog
/// The exception to display
- void ShowExceptionDialog(string title, Exception exception);
+ ///
+ void ShowExceptionDialog(string title, Exception exception, string? customMessage = null);
///
/// Creates a view model instance of type and shows its corresponding View as a
diff --git a/src/Artemis.UI.Shared/Services/Window/ExceptionDialogView.axaml b/src/Artemis.UI.Shared/Services/Window/ExceptionDialogView.axaml
index 871d01354..98c4fbe9e 100644
--- a/src/Artemis.UI.Shared/Services/Window/ExceptionDialogView.axaml
+++ b/src/Artemis.UI.Shared/Services/Window/ExceptionDialogView.axaml
@@ -22,9 +22,7 @@
Awww :(
-
- It looks like Artemis ran into an unexpected error. If this keeps happening feel free to hit us up on Discord.
-
+
diff --git a/src/Artemis.UI.Shared/Services/Window/ExceptionDialogViewModel.cs b/src/Artemis.UI.Shared/Services/Window/ExceptionDialogViewModel.cs
index 3bb88df15..61ee716ce 100644
--- a/src/Artemis.UI.Shared/Services/Window/ExceptionDialogViewModel.cs
+++ b/src/Artemis.UI.Shared/Services/Window/ExceptionDialogViewModel.cs
@@ -9,15 +9,17 @@ internal class ExceptionDialogViewModel : DialogViewModelBase
diff --git a/src/Artemis.UI/Services/Updating/WorkshopUpdateService.cs b/src/Artemis.UI/Services/Updating/WorkshopUpdateService.cs
index 6f1f267e5..8850de70e 100644
--- a/src/Artemis.UI/Services/Updating/WorkshopUpdateService.cs
+++ b/src/Artemis.UI/Services/Updating/WorkshopUpdateService.cs
@@ -3,6 +3,7 @@ using System.Threading;
using System.Threading.Tasks;
using Artemis.Core;
using Artemis.Core.Services;
+using Artemis.UI.Extensions;
using Artemis.UI.Services.Interfaces;
using Artemis.UI.Shared.Utilities;
using Artemis.WebClient.Workshop;
@@ -69,6 +70,12 @@ public class WorkshopUpdateService : IWorkshopUpdateService
if (latestRelease.Id == installedEntry.ReleaseId)
return false;
+ if (!latestRelease.IsCompatible())
+ {
+ _logger.Information("Skipping auto-update of entry {Entry} because it requires a newer version of Artemis ({RequiredVersion})", entry, latestRelease.MinimumVersion);
+ return false;
+ }
+
_logger.Information("Auto-updating entry {Entry} to version {Version}", entry, latestRelease.Version);
EntryInstallResult updateResult = await _workshopService.InstallEntry(entry, latestRelease, new Progress(), CancellationToken.None);
diff --git a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/EntryInstallResult.cs b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/EntryInstallResult.cs
index 7e05fe28b..1277c08ee 100644
--- a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/EntryInstallResult.cs
+++ b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/EntryInstallResult.cs
@@ -15,6 +15,11 @@ public class EntryInstallResult
///
public string? Message { get; private set; }
+ ///
+ /// Gets an exception thrown during the installation process, if any.
+ ///
+ public Exception? Exception { get; private set; }
+
///
/// Gets the entry that was installed, if any.
///
@@ -34,6 +39,16 @@ public class EntryInstallResult
Message = message
};
}
+
+ public static EntryInstallResult FromException(Exception exception)
+ {
+ return new EntryInstallResult
+ {
+ IsSuccess = false,
+ Message = exception.Message,
+ Exception = exception
+ };
+ }
public static EntryInstallResult FromSuccess(InstalledEntry installedEntry, object? result)
{
diff --git a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/LayoutEntryInstallationHandler.cs b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/LayoutEntryInstallationHandler.cs
index 7636c5def..a336fa3b3 100644
--- a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/LayoutEntryInstallationHandler.cs
+++ b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/LayoutEntryInstallationHandler.cs
@@ -37,7 +37,7 @@ public class LayoutEntryInstallationHandler : IEntryInstallationHandler
}
catch (Exception e)
{
- return EntryInstallResult.FromFailure(e.Message);
+ return EntryInstallResult.FromException(e);
}
// Ensure there is an installed entry
diff --git a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/PluginEntryInstallationHandler.cs b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/PluginEntryInstallationHandler.cs
index b4451d9cf..80a3cb012 100644
--- a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/PluginEntryInstallationHandler.cs
+++ b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/PluginEntryInstallationHandler.cs
@@ -51,7 +51,7 @@ public class PluginEntryInstallationHandler : IEntryInstallationHandler
}
catch (Exception e)
{
- return EntryInstallResult.FromFailure(e.Message);
+ return EntryInstallResult.FromException(e);
}
// Create the release directory
@@ -102,8 +102,9 @@ public class PluginEntryInstallationHandler : IEntryInstallationHandler
// ignored, will get cleaned up as an orphaned file
}
- _workshopService.RemoveInstalledEntry(installedEntry);
- return EntryInstallResult.FromFailure(e.Message);
+ if (installedEntry.Entity.Id != Guid.Empty)
+ _workshopService.RemoveInstalledEntry(installedEntry);
+ return EntryInstallResult.FromException(e);
}
return ApplyAndSave(plugin, installedEntry, release);
diff --git a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/ProfileEntryInstallationHandler.cs b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/ProfileEntryInstallationHandler.cs
index f16aa8d36..6bbd35754 100644
--- a/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/ProfileEntryInstallationHandler.cs
+++ b/src/Artemis.WebClient.Workshop/Handlers/InstallationHandlers/Implementations/ProfileEntryInstallationHandler.cs
@@ -32,7 +32,7 @@ public class ProfileEntryInstallationHandler : IEntryInstallationHandler
}
catch (Exception e)
{
- return EntryInstallResult.FromFailure(e.Message);
+ return EntryInstallResult.FromException(e);
}
// Find existing installation to potentially replace the profile
diff --git a/src/Artemis.WebClient.Workshop/Queries/Fragments.graphql b/src/Artemis.WebClient.Workshop/Queries/Fragments.graphql
index f1c94bfa2..afa95d404 100644
--- a/src/Artemis.WebClient.Workshop/Queries/Fragments.graphql
+++ b/src/Artemis.WebClient.Workshop/Queries/Fragments.graphql
@@ -79,6 +79,7 @@ fragment entryDetails on Entry {
fragment release on Release {
id
version
+ minimumVersion
downloadSize
md5Hash
createdAt
diff --git a/src/Artemis.WebClient.Workshop/schema.graphql b/src/Artemis.WebClient.Workshop/schema.graphql
index ebc1d6535..4962e89b2 100644
--- a/src/Artemis.WebClient.Workshop/schema.graphql
+++ b/src/Artemis.WebClient.Workshop/schema.graphql
@@ -138,8 +138,6 @@ type PluginInfo {
entryId: Long!
entry: Entry!
pluginGuid: UUID!
- api: Int
- minmumVersion: String
website: String
helpPage: String
repository: String
@@ -253,6 +251,7 @@ type Release {
downloads: Long!
downloadSize: Long!
md5Hash: String
+ minimumVersion: Long
entry: Entry!
entryId: Long!
dependencies: [Entry!]!
@@ -532,8 +531,6 @@ input PluginInfoFilterInput {
entryId: LongOperationFilterInput
entry: EntryFilterInput
pluginGuid: UuidOperationFilterInput
- api: IntOperationFilterInput
- minmumVersion: StringOperationFilterInput
website: StringOperationFilterInput
helpPage: StringOperationFilterInput
repository: StringOperationFilterInput
@@ -547,8 +544,6 @@ input PluginInfoSortInput {
entryId: SortEnumType @cost(weight: "10")
entry: EntrySortInput @cost(weight: "10")
pluginGuid: SortEnumType @cost(weight: "10")
- api: SortEnumType @cost(weight: "10")
- minmumVersion: SortEnumType @cost(weight: "10")
website: SortEnumType @cost(weight: "10")
helpPage: SortEnumType @cost(weight: "10")
repository: SortEnumType @cost(weight: "10")
@@ -575,6 +570,7 @@ input ReleaseFilterInput {
downloads: LongOperationFilterInput
downloadSize: LongOperationFilterInput
md5Hash: StringOperationFilterInput
+ minimumVersion: LongOperationFilterInput
entry: EntryFilterInput
entryId: LongOperationFilterInput
dependencies: ListFilterInputTypeOfEntryFilterInput
@@ -588,6 +584,7 @@ input ReleaseSortInput {
downloads: SortEnumType @cost(weight: "10")
downloadSize: SortEnumType @cost(weight: "10")
md5Hash: SortEnumType @cost(weight: "10")
+ minimumVersion: SortEnumType @cost(weight: "10")
entry: EntrySortInput @cost(weight: "10")
entryId: SortEnumType @cost(weight: "10")
}