mirror of
https://github.com/burakgon/OpenScreens.git
synced 2026-12-02 02:49:22 +08:00
The Mac app looks at the project's releases on GitHub when it is first opened and once a day after that, and when there is a newer one says so at the top of the library, with what is in it. One choice there downloads it, has it checked, installs it and opens the app again. Settings has a pane for it, and the app menu has Check for Updates. Sparkle does what must not be got wrong: reading the feed, downloading, checking the signatures, putting the app in place. The feed has to be signed with the project's key and so does the download, which is checked before it is unpacked. None of what is shown is Sparkle's. It hands each step to an UpdateModel, which knows nothing of Sparkle and holds the rules: - What the user asked about is shown at once. What was found in the background is shown at once only when no session is open; beside a session it waits in the notice. - An update that was chosen is installed when it is ready, without a second question, unless a session has been opened in the meantime. - The sheet is closed before the app is asked to quit. An app with a sheet up does not quit when the system asks it to, which is how Sparkle asks: tried with the update's own sheet up, the app stayed where it was with the update unpacked beside it, and installed it only when it was quit by hand. Should the app still be running a moment after it was asked, it is asked again with any sheet out of the way, and after that the notice says to quit it. - A check that is asked for while Sparkle is in the middle of one of its own is not dropped, as Sparkle would drop it: the user sees that the app is looking, and Sparkle is asked when it can be. On every platform the first launch after an update says what changed, from a copy of the change log that the app carries. scripts/sync-changelog.sh makes the copy, and a test fails while it is stale. Two environment variables are there for trying an update out: one names another feed to read, the other has the app answer for itself. Neither gets anything installed that the app would not have taken anyway, since the feed and the download still have to be signed with the key the app trusts.