Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for emitting events from winsparkle #43

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

cybrox
Copy link
Contributor

@cybrox cybrox commented Mar 30, 2023

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:

  • error
  • shutdownRequest
  • didFindUpdate
  • didNotFindUpdate
  • updateCancelled

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
Copy link
Member

lijy91 commented Mar 31, 2023

LGTM

@lijy91 lijy91 merged commit d2aa4b2 into leanflutter:main Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants