From be7ada726178120bfcf3fb924691fc078a21645f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Korczy=C5=84ski?= Date: Sat, 16 Oct 2021 20:41:46 +0100 Subject: [PATCH] Using native standalone Linux skia sharp libraries --- WDE.Updater/Services/StandaloneUpdater.cs | 22 +++++++++++++++++-- .../WoWDatabaseEditorCore.Avalonia.csproj | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/WDE.Updater/Services/StandaloneUpdater.cs b/WDE.Updater/Services/StandaloneUpdater.cs index 5aa65e7f9..5fd1fa98a 100644 --- a/WDE.Updater/Services/StandaloneUpdater.cs +++ b/WDE.Updater/Services/StandaloneUpdater.cs @@ -1,6 +1,9 @@ +using System; using System.Diagnostics; using System.IO; using WDE.Common.Services; +using WDE.Common.Services.MessageBox; +using WDE.Common.Utils; using WDE.Module.Attributes; namespace WDE.Updater.Services @@ -11,11 +14,13 @@ public class StandaloneUpdater : IStandaloneUpdater { private readonly IAutoUpdatePlatformService platform; private readonly IFileSystem fs; + private readonly IMessageBoxService messageBoxService; - public StandaloneUpdater(IAutoUpdatePlatformService platform, IFileSystem fs) + public StandaloneUpdater(IAutoUpdatePlatformService platform, IFileSystem fs, IMessageBoxService messageBoxService) { this.platform = platform; this.fs = fs; + this.messageBoxService = messageBoxService; } public bool HasPendingUpdate() @@ -59,7 +64,20 @@ private bool TryLaunch(string file) { if (File.Exists(file)) { - Process.Start(file); + try + { + Process.Start(file); + } + catch (Exception e) + { + messageBoxService.ShowDialog(new MessageBoxFactory() + .SetTitle("Updater") + .SetMainInstruction("Error while starting the updater") + .SetContent("While trying to start the updater, following error occured: " + e.Message + + ".\n\nYou can try to run the Updater.exe (Updater on Linux) manually") + .WithOkButton(true) + .Build()).ListenErrors(); + } return true; } diff --git a/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj b/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj index 9ea460281..fda9c35e0 100644 --- a/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj +++ b/WoWDatabaseEditorCore.Avalonia/WoWDatabaseEditorCore.Avalonia.csproj @@ -20,6 +20,7 @@ +