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
606 stars 84 forks source link

WinForms closing form #383

Closed schtritoff closed 1 year ago

schtritoff commented 1 year ago

When using NetSparkle.UI.WinForms.NetCore and some form is shown once - for example by calling CheckForUpdatesAtUserRequest() if user wants to check again it will throw an error that the form is disposed. Why is that? Because in class CheckingForUpdatesWindow in lines 77 and 83 (see below, but also happen in other classes) the form is being closed on 'OK' or 'Close' button click, why don't we instead of closing the form, call Form.Hide() method?

https://github.com/NetSparkleUpdater/NetSparkle/blob/231b301babf15f4e3a4e7bc3de0d7b2e871d9ab1/src/NetSparkle.UI.WinForms.NetCore/CheckingForUpdatesWindow.cs#L69-L85

Deadpikle commented 1 year ago

Hi @schtritoff,

Thanks for bringing this up. We want to get rid of the form, but actually the underlying problem was that we were not calling the UpdatesUIClosing event from the .NET Core WinForms UI library. I'll be uploading a fix for this soon. Thank you for reporting!!

Deadpikle commented 1 year ago

You can test this bugfix out in 2.1.4-preview20221106001, rolling out now via CI/CD.

schtritoff commented 1 year ago

Now works OK in 2.1.4-preview20221106001.

Thanks