update
This commit is contained in:
@@ -12,7 +12,6 @@ public static class Program
|
|||||||
|
|
||||||
private static readonly SettingsManager settingsManager;
|
private static readonly SettingsManager settingsManager;
|
||||||
|
|
||||||
public static string ProcessPath = EnvironmentEx.ProcessPath!;
|
|
||||||
public static ISettings Settings => settingsManager.Instance;
|
public static ISettings Settings => settingsManager.Instance;
|
||||||
public static ILogger Log { get; } = new ConsoleLogger();
|
public static ILogger Log { get; } = new ConsoleLogger();
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ public static class Program
|
|||||||
[STAThread]
|
[STAThread]
|
||||||
internal static void Main(string[] args)
|
internal static void Main(string[] args)
|
||||||
{
|
{
|
||||||
AppGlobals.Initialize();
|
|
||||||
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
BuildAvaloniaApp().StartWithClassicDesktopLifetime(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,11 +7,8 @@ using ModpackUpdater.Apps.Manager.Api;
|
|||||||
using ModpackUpdater.Apps.Manager.Api.Model;
|
using ModpackUpdater.Apps.Manager.Api.Model;
|
||||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Features;
|
||||||
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
|
||||||
using ModpackUpdater.Apps.Manager.LangRes;
|
|
||||||
using ModpackUpdater.Apps.Manager.Settings;
|
using ModpackUpdater.Apps.Manager.Settings;
|
||||||
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
using ModpackUpdater.Apps.Manager.Ui.Models.MainWindow;
|
||||||
using MsBox.Avalonia;
|
|
||||||
using MsBox.Avalonia.Enums;
|
|
||||||
using Pilz.Extensions;
|
using Pilz.Extensions;
|
||||||
using Pilz.Features;
|
using Pilz.Features;
|
||||||
using Pilz.UI.AvaloniaUI.Features;
|
using Pilz.UI.AvaloniaUI.Features;
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class AppUpdates(string updateUrl, Window mainWindow)
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
await MessageBoxManager.GetMessageBoxStandard(MsgBoxLangRes.UpdateAvailable_Title, string.Format(MsgBoxLangRes.UpdateAvailable, ex.Message), ButtonEnum.YesNo, MsBox.Avalonia.Enums.Icon.Info).ShowWindowAsync();
|
await MessageBoxManager.GetMessageBoxStandard(GeneralMsgBoxLangRes.UpdateAvailable_Title, string.Format(GeneralMsgBoxLangRes.UpdateAvailable, ex.Message), ButtonEnum.YesNo, MsBox.Avalonia.Enums.Icon.Info).ShowWindowAsync();
|
||||||
mainWindow.IsEnabled = true;
|
mainWindow.IsEnabled = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -41,7 +41,7 @@ public class AppUpdates(string updateUrl, Window mainWindow)
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (await updater.CheckForUpdate() is {} packageToInstall
|
if (await updater.CheckForUpdate() is {} packageToInstall
|
||||||
&& await MessageBoxManager.GetMessageBoxStandard(MsgBoxLangRes.UpdateAvailable_Title, MsgBoxLangRes.UpdateAvailable, ButtonEnum.YesNo, MsBox.Avalonia.Enums.Icon.Info).ShowWindowDialogAsync(mainWindow) == ButtonResult.Yes)
|
&& await MessageBoxManager.GetMessageBoxStandard(GeneralMsgBoxLangRes.UpdateAvailable_Title, GeneralMsgBoxLangRes.UpdateAvailable, ButtonEnum.YesNo, MsBox.Avalonia.Enums.Icon.Info).ShowWindowDialogAsync(mainWindow) == ButtonResult.Yes)
|
||||||
{
|
{
|
||||||
OnDownloadProgramUpdate?.Invoke(this, EventArgs.Empty);
|
OnDownloadProgramUpdate?.Invoke(this, EventArgs.Empty);
|
||||||
mainWindow.IsEnabled = false;
|
mainWindow.IsEnabled = false;
|
||||||
|
|||||||
@@ -14,21 +14,21 @@ namespace ModpackUpdater.Apps {
|
|||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||||
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
[System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||||
public class MsgBoxLangRes {
|
internal class GeneralMsgBoxLangRes {
|
||||||
|
|
||||||
private static System.Resources.ResourceManager resourceMan;
|
private static System.Resources.ResourceManager resourceMan;
|
||||||
|
|
||||||
private static System.Globalization.CultureInfo resourceCulture;
|
private static System.Globalization.CultureInfo resourceCulture;
|
||||||
|
|
||||||
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||||
internal MsgBoxLangRes() {
|
internal GeneralMsgBoxLangRes() {
|
||||||
}
|
}
|
||||||
|
|
||||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
public static System.Resources.ResourceManager ResourceManager {
|
internal static System.Resources.ResourceManager ResourceManager {
|
||||||
get {
|
get {
|
||||||
if (object.Equals(null, resourceMan)) {
|
if (object.Equals(null, resourceMan)) {
|
||||||
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ModpackUpdater.Apps.LangRes.MsgBoxLangRes", typeof(MsgBoxLangRes).Assembly);
|
System.Resources.ResourceManager temp = new System.Resources.ResourceManager("ModpackUpdater.Apps.LangRes.GeneralMsgBoxLangRes", typeof(GeneralMsgBoxLangRes).Assembly);
|
||||||
resourceMan = temp;
|
resourceMan = temp;
|
||||||
}
|
}
|
||||||
return resourceMan;
|
return resourceMan;
|
||||||
@@ -36,7 +36,7 @@ namespace ModpackUpdater.Apps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||||
public static System.Globalization.CultureInfo Culture {
|
internal static System.Globalization.CultureInfo Culture {
|
||||||
get {
|
get {
|
||||||
return resourceCulture;
|
return resourceCulture;
|
||||||
}
|
}
|
||||||
@@ -45,25 +45,25 @@ namespace ModpackUpdater.Apps {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string UpdateAvailable {
|
internal static string UpdateAvailable {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("UpdateAvailable", resourceCulture);
|
return ResourceManager.GetString("UpdateAvailable", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string UpdateAvailable_Title {
|
internal static string UpdateAvailable_Title {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("UpdateAvailable_Title", resourceCulture);
|
return ResourceManager.GetString("UpdateAvailable_Title", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ErrorWhileUpdate_Title {
|
internal static string ErrorWhileUpdate_Title {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("ErrorWhileUpdate_Title", resourceCulture);
|
return ResourceManager.GetString("ErrorWhileUpdate_Title", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string ErrorWhileUpdate {
|
internal static string ErrorWhileUpdate {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("ErrorWhileUpdate", resourceCulture);
|
return ResourceManager.GetString("ErrorWhileUpdate", resourceCulture);
|
||||||
}
|
}
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="Symbols\*.svg" />
|
<EmbeddedResource Include="Symbols\*.svg" />
|
||||||
<EmbeddedResource Update="LangRes\MsgBoxLangRes.resx">
|
<EmbeddedResource Update="LangRes\GeneralMsgBoxLangRes.resx">
|
||||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
<Generator>ResXFileCodeGenerator</Generator>
|
||||||
<LastGenOutput>MsgBoxLangRes.Designer.cs</LastGenOutput>
|
<LastGenOutput>MsgBoxLangRes.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -43,10 +43,10 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>GeneralLangRes.resx</DependentUpon>
|
<DependentUpon>GeneralLangRes.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="LangRes\MsgBoxLangRes.Designer.cs">
|
<Compile Update="LangRes\GeneralMsgBoxLangRes.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DependentUpon>MsgBoxLangRes.resx</DependentUpon>
|
<DependentUpon>GeneralMsgBoxLangRes.resx</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Update="LangRes\MsgBoxLangRes.Designer.cs">
|
<Compile Update="LangRes\MsgBoxLangRes.Designer.cs">
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
|
|||||||
Reference in New Issue
Block a user