AutoUpdater.NET icon indicating copy to clipboard operation
AutoUpdater.NET copied to clipboard

ParseUpdateInfoEvent without an Appcast file

Open sitiom opened this issue 3 years ago • 0 comments

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.

sitiom avatar Dec 13 '20 05:12 sitiom

@ravibpatel Is this fixed now?

sitiom avatar Sep 02 '22 11:09 sitiom

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.

ravibpatel avatar Sep 02 '22 12:09 ravibpatel