Is it possible to run a checkForUpdates() and to silently finish if the current version is up to date ? #2292
Replies: 4 comments 1 reply
-
Wrong API. checkForUpdates is only intended for user-initiated checks. API Expectations covers the API you might be looking for plus additional information on correct usage. |
Beta Was this translation helpful? Give feedback.
-
@zorgiepoo - I must be missing something as I can't find any basic explanation for how to create a default Sparkle implementation and how it works in this documentation. I have a very simple requirement to simply include Sparkle in the application and to then automatically check for updates - no problem with automatically asking the user for permission to do so. Do I assume that the only implementation method is to create a menu option the user needs to use to trigger an check for updates, when this check is run the first time Sparkle will then ask the user if they want to automatically check for updates. If the response is YES then the Sparkle framework will automatically perform future checks. Am I correct in assuming that even with the menu option for the user to trigger a check - the Sparkle framework will not automatically check for updates UNLESS the user has triggered a check at least one manually ? If there is a simple concise description of the recommended usage on macOS that I have missed please provide a link. Thanks. |
Beta Was this translation helpful? Give feedback.
-
Okay, Sparkle does this automatically.
checkForUpdates is intended only for the user, so like from a "Check for Updates…" menu item in your application menu.
Sparkle asks for permission on 2nd launch to automatically check for updates. If the user wants automatic update checking, Sparkle does a re-occurring update check in the background after 24 hours has passed (by default).
No. Having a menu option check for the user that uses checkForUpdates is independent from Sparkle automatically asking the user permission and automatically checking for updates on its own. To check for updates automatically in the background, Sparkle calls checkForUpdatesInBackground periodically including on app launch if 24 hours (the default time interval) has passed since the last update check. Hence it is not strictly necessary for you to call checkForUpdatesInBackground (what you were originally asking) on every launch unless you always want the update check to be done at that specific point of time. The API Expecations link I referred you to above describes this. If you do call this manually you should probably only do so if automaticallyCheckForUpdates is YES (which would mean the user gave permission to check for updates automatically and the user hasn't disabled automatic update checks). |
Beta Was this translation helpful? Give feedback.
-
Thanks. It would be good to include an explanation like the one above re usage/behaviour. So had I launched twice I would have/should have seen the prompt for automatic checks. |
Beta Was this translation helpful? Give feedback.
-
I want to automatically run a check when the app starts but don't want to keep showing the "This app is the latest version" dialog each time.
I there any way to suppress this message if the application is current ?
Beta Was this translation helpful? Give feedback.
All reactions