fix release build

This commit is contained in:
2025-11-08 18:36:45 +01:00
parent 091d820332
commit a573f4fb89
2 changed files with 87 additions and 22 deletions

View File

@@ -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