NetSparkleUpdater / NetSparkle

NetSparkle is a C#, cross-platform, highly-configurable software update framework with pre-built UI for .NET developers compatible with .NET 4.6.2/.NET 6+, WinForms, WPF, and Avalonia; uses Ed25519 signatures. View basic usage here in the README and try the samples for yourself.
https://netsparkleupdater.github.io/NetSparkle/
MIT License
625 stars 85 forks source link

UpdateAvailableResult.None not working? #169

Closed ghost closed 3 years ago

ghost commented 3 years ago

Using UIFactory for WinForms. I want to know when the user closes the "Update Available" window. I have subscribed to the "UserRespondedToUpdate" event. The "UpdateAvailableResult.None" event result doesn't works.

private void _sparkleUpdateDetector_UserRespondedToUpdate(object sender, NetSparkleUpdater.Events.UpdateResponseEventArgs e)
{
    if (e.Result == UpdateAvailableResult.RemindMeLater)
    {
        Console.WriteLine("UpdateAvailableResult.RemindMeLater");
    }
    if (e.Result == UpdateAvailableResult.None)
    {
        // Not working
        Console.WriteLine("UpdateAvailableResult.None");
    }
}

Is this a bug or am I doing it wrong? Or is there even a way to detect when a "SparkleUpdater" has all it's windows closed?

Thanks!

Deadpikle commented 3 years ago

@Kyberal Hi! Welcome!

Thanks for reporting this. I believe you've found a bug. 😅 The .None case is not being handled when the user update window is closed.

https://github.com/NetSparkleUpdater/NetSparkle/blob/d9e2297c0a6eff12b0a30d0aecc6b699f6ac2267/src/NetSparkle/SparkleUpdater.cs#L1662-L1688

Deadpikle commented 3 years ago

Had to fix this in multiple UI packages and in the core library. The WinForms UI frontend was working already.

The bug fix has been pushed out in the following NuGet package: 2.0.0-preview20210314001