diff --git a/.idea/.idea.ModpackUpdater/.idea/workspace.xml b/.idea/.idea.ModpackUpdater/.idea/workspace.xml index f6d7ae0..be27d52 100644 --- a/.idea/.idea.ModpackUpdater/.idea/workspace.xml +++ b/.idea/.idea.ModpackUpdater/.idea/workspace.xml @@ -7,18 +7,22 @@ ModpackUpdater.Apps.Client/ModpackUpdater.Apps.Client.csproj ModpackUpdater.Apps.Manager/ModpackUpdater.Apps.Manager.csproj + + - - - - + + + + @@ -38,6 +42,7 @@ "second": "7f2fcd6a-63d8-4d22-90ae-c2bb14a72d8d" } } + { "customColor": "", "associatedIndex": 1 @@ -47,18 +52,25 @@ - { - "keyToString": { - "ModuleVcsDetector.initialDetectionPerformed": "true", - "RunOnceActivity.ShowReadmeOnStart": "true", - "RunOnceActivity.git.unshallow": "true", - "git-widget-placeholder": "master", - "nodejs_package_manager_path": "npm", - "settings.editor.selected.configurable": "RiderNuGetOptionsPageId", - "vue.rearranger.settings.migration": "true" + - +}]]> + @@ -79,6 +91,34 @@ + + + + + + + @@ -88,15 +128,28 @@ + + + + diff --git a/ModpackUpdater.Apps.Client.Gui/MainForm.axaml.cs b/ModpackUpdater.Apps.Client.Gui/MainForm.axaml.cs index a33d57e..e80e9a8 100644 --- a/ModpackUpdater.Apps.Client.Gui/MainForm.axaml.cs +++ b/ModpackUpdater.Apps.Client.Gui/MainForm.axaml.cs @@ -7,10 +7,15 @@ using Avalonia.Platform.Storage; using Avalonia.Threading; using ModpackUpdater.Apps.Client.Gui.LangRes; using ModpackUpdater.Manager; +using MsBox.Avalonia; +using MsBox.Avalonia.Enums; +using Pilz; using Pilz.Extensions; +using Pilz.Runtime; using Pilz.SymbolPacks.Sets; using Pilz.UI.AvaloniaUI.Symbols; using Pilz.UI.Symbols; +using Pilz.Updating.Client; namespace ModpackUpdater.Apps.Client.Gui; @@ -259,11 +264,11 @@ public partial class MainForm : Window AppConfig.Instance.LastMinecraftProfilePath = TextBoxMinecraftProfileFolder.Text?.Trim(); } - private async void MainForm_Loaded(object? sender, RoutedEventArgs e) + private async Task UpdateApp() { -#if !DISABLE_UPDATE && !DEBUG - try - { + if (Debugger.IsAttached) + return; + var myAppPath = EnvironmentEx.ProcessPath!; var updater = new UpdateClient(Program.UpdateUrl, Assembly.GetEntryAssembly()!.GetAppVersion(), AppChannel.Stable) { @@ -285,10 +290,17 @@ public partial class MainForm : Window } IsEnabled = true; } - } - catch (Exception ex) + } + + private async void MainForm_Loaded(object? sender, RoutedEventArgs e) + { +#if !DISABLE_UPDATE + try + { + await UpdateApp(); + } + catch { - await MessageBoxManager.GetMessageBoxStandard("error", ex.ToString(), ButtonEnum.Ok, MsBox.Avalonia.Enums.Icon.Error).ShowWindowDialogAsync(this); IsEnabled = true; } #endif