AutoUpdater.NET
AutoUpdater.NET copied to clipboard
ParseUpdateInfoEvent without an Appcast file
In my use case, I would want to get the latest release on GitHub. I saw #296 however I use a client API (Octokit.Net) to fetch the latest release.
Normally I what I would want to do is:
using Octokit;
// ...
AutoUpdater.ParseUpdateInfoEvent += AutoUpdater_ParseUpdateInfoEvent;
AutoUpdater.Start();
private static void AutoUpdater_ParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
{
GitHubClient client = new GitHubClient(new ProductHeaderValue("program"));
Release release = client.Repository.Release.GetLatest("sitiom", "program").Result
// Do stuff
}
However, this fails, as the AppCast file is not set or is invalid. So I set a dummy file:
using Octokit;
// ...
AutoUpdater.ParseUpdateInfoEvent += AutoUpdater_ParseUpdateInfoEvent;
// Dummy file to trigger ParseUpdateInfoEvent
AutoUpdater.Start("https://github.com/sitiom/program/README.md");
private static void AutoUpdater_ParseUpdateInfoEvent(ParseUpdateInfoEventArgs args)
{
GitHubClient client = new GitHubClient(new ProductHeaderValue("program"));
Release release = client.Repository.Release.GetLatest("sitiom", "program").Result
// Do stuff
}
It would be great if don't have to do that anymore.
@ravibpatel Is this fixed now?
It is similar to #251. In the future, I may release a version that will allow you to pass the update info directly to the start method, so you don't have to use the XML at all.