leanflutter / auto_updater

This plugin allows Flutter desktop apps to automatically update themselves (based on sparkle and winsparkle).
MIT License
285 stars 41 forks source link

feat: add support for emitting events from winsparkle #43

Closed cybrox closed 1 year ago

cybrox commented 1 year ago

This PR adds a sparkleEvents property to autoUpdater, which is a Stream<String> that a user can use to listen to callback events emitted by WinSparkle such as didFindUpdate or didNotFindUpdate.

On the Windows side, callbacks are registered in setFeedUrl, because currently WinSparkle is only initialized after this is called.

There might be a better way to handle the callbacks (without moving the channel pointer) but I'm no C++ expert, so this is the best solution I could come up with.

The events that can currently be emitted are:

There is a different subset of events existing in the OSX implementation but these are the ones WinSparkle 0.7.0 supports.

If that's OK for you, I'd proceed with:

  1. [this MR]
  2. Update WinSparkle to 0.8.0
  3. Implement the remaining events and adjusting the MacOS Swift code to match the Windows side
lijy91 commented 1 year ago

LGTM