fix release build
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user