merge update urls and include app short name in distro

This commit is contained in:
2025-11-21 19:52:58 +01:00
parent e7aa79db64
commit c864d9125a
5 changed files with 7 additions and 9 deletions

View File

@@ -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();

View File

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

View File

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

View File

@@ -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,
};

View File

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