merge update urls and include app short name in distro
This commit is contained in:
@@ -306,7 +306,7 @@ public partial class MainForm : Window
|
||||
|
||||
private async void MainForm_Loaded(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var updates = new AppUpdates(Program.UpdateUrl, this);
|
||||
var updates = new AppUpdates("manager", this);
|
||||
updates.OnDownloadProgramUpdate += (_, _) => SetStatus(GeneralLangRes.DownloadProgramUpdate, AppGlobals.Symbols.GetImageSource(AppSymbols.software_installer));
|
||||
await updates.UpdateApp();
|
||||
ClearStatus();
|
||||
|
||||
@@ -8,8 +8,6 @@ namespace ModpackUpdater.Apps.Client.Gui;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public const string UpdateUrl = "https://git.pilzinsel64.de/litw-refined/minecraft-modpack-updater/-/snippets/3/raw/main/updates-new.json";
|
||||
|
||||
private static readonly SettingsManager settingsManager;
|
||||
|
||||
public static ISettings Settings => settingsManager.Instance;
|
||||
|
||||
@@ -7,8 +7,6 @@ namespace ModpackUpdater.Apps.Manager;
|
||||
|
||||
public static class Program
|
||||
{
|
||||
public const string UpdateUrl = "https://git.pilzinsel64.de/litw-refined/minecraft-modpack-updater/-/snippets/3/raw/main/updates-manager.json";
|
||||
|
||||
internal static readonly SettingsManager settingsManager;
|
||||
|
||||
public static ISettings Settings => settingsManager.Instance;
|
||||
|
||||
@@ -127,7 +127,7 @@ public partial class MainWindow : Window, IMainApi
|
||||
|
||||
private async void Window_OnLoaded(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
var updater = new AppUpdates(Program.UpdateUrl, this)
|
||||
var updater = new AppUpdates("client", this)
|
||||
{
|
||||
UsePopups = true,
|
||||
};
|
||||
|
||||
@@ -10,8 +10,10 @@ using Pilz.Updating.Client;
|
||||
|
||||
namespace ModpackUpdater.Apps;
|
||||
|
||||
public class AppUpdates(string updateUrl, Window mainWindow)
|
||||
public class AppUpdates(string appShortName, Window mainWindow)
|
||||
{
|
||||
public const string UpdateUrl = "https://git.pilzinsel64.de/litw-refined/minecraft-modpack-updater/-/snippets/3/raw/main/updates-new.json";
|
||||
|
||||
public event EventHandler? OnDownloadProgramUpdate;
|
||||
|
||||
public bool UsePopups { get; set; }
|
||||
@@ -39,9 +41,9 @@ public class AppUpdates(string updateUrl, Window mainWindow)
|
||||
return;
|
||||
|
||||
var myAppPath = EnvironmentEx.ProcessPath!;
|
||||
var updater = new UpdateClient(updateUrl, Assembly.GetEntryAssembly()!.GetAppVersion(), AppChannel.Stable)
|
||||
var updater = new UpdateClient(UpdateUrl, Assembly.GetEntryAssembly()!.GetAppVersion(), AppChannel.Stable)
|
||||
{
|
||||
Distro = RuntimeInformationsEx.GetRuntimeIdentifier(),
|
||||
Distro = $"{appShortName}-{RuntimeInformationsEx.GetRuntimeIdentifier()}",
|
||||
};
|
||||
|
||||
if (await updater.CheckForUpdate() is not { } packageToInstall || await AskForUpdate() != ButtonResult.Yes)
|
||||
|
||||
Reference in New Issue
Block a user