basic default settings question

Asked by livings124

Hello,

I want to use Sparkle 1.5 to check for updates once a day (and always display a prompt). Am I right in that I would set in Info.plist SUScheduledCheckInterval to 60*60*24, and in the user prefs SUEnableAutomaticChecks to YES/NO depending on if they want to check daily? In Sparkle 1.1 I was toggling the check interval between 0 and the interval and not changing any other values; can I now just leave that value constant regardless if checking is enabled?

Also, what are SUAutomaticallyUpdate and SUAllowsAutomaticUpdates used for? Should I bother setting those if all I want is daily checking with a user prompt when there's an update?

Thanks,
Mitch

Question information

Language:
English Edit question
Status:
Answered
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
livings124 (livings124) said :
#1

Also, If I change SUEnableAutomaticChecksKey (or whatever is used to toggle checking) in NSUserDefaults, do I still have to call setAutomaticallyChecksForUpdates:, or will bindings take care of it?

Revision history for this message
Andy Matuschak (andymatuschak) said :
#2

> Am I right in that I would set in Info.plist SUScheduledCheckInterval to 60*60*24.

Yep.

> in the user prefs SUEnableAutomaticChecks to YES/NO depending on if they want to check daily?

Yeah, but you shouldn't touch that key yourself. Let the Sparkle dialog do it. Or call setAutomaticallyChecksForUpdates: on the SUUpdater object to manage the setting. That's a KVO-compliant key.

Revision history for this message
livings124 (livings124) said :
#3

> Yeah, but you shouldn't touch that key yourself.

I set this in the default preferences, and have it bound to the check button so I don't have to do anything else with out. I can't seem to get the autoupdate dialog to appear (I set the version of the app to a lower value and SUScheduledCheckInterval to 60).

Revision history for this message
Hofman (cmhofman) said :
#4

> I set this in the default preferences, and have it bound to the check button so I don't have to do anything else with out.

Accessing the user defaults keys is now reserved to Sparkle. You can effectively set a default value for this pref in Info.plist.

> I can't seem to get the autoupdate dialog to appear (I set the version of the app to a lower value and SUScheduledCheckInterval to 60).

Sparkle forces a minimum check interval of one hour (unless you're using a Debug build, in which case it's a minute).

Apart from this I also think that a zero check interval should be interpreted as disabling update checking. If not just for compatibility with Sparkle 1.1 (see my bug report for more reasons).

Revision history for this message
livings124 (livings124) said :
#5

> Accessing the user defaults keys is now reserved to Sparkle. You can effectively set a default value for this pref in Info.plist.

So I can't use bindings for this value and have to manually enable the check and call setAutomaticallyChecksForUpdates:?

> Apart from this I also think that a zero check interval should be interpreted as disabling update checking.

But leaving the interval always at some value and manually toggling SUEnableAutomaticChecksKey / calling setAutomaticallyChecksForUpdates: will toggle update checking as well, right?

Sorry about these questions, I'm just trying to grasp the exact behavior.

Revision history for this message
Hofman (cmhofman) said :
#6

> So I can't use bindings for this value and have to manually enable the check and call setAutomaticallyChecksForUpdates:?

You can bind directly to the (shared) updater, as SUUpdater is KVC compliant for this key.

> But leaving the interval always at some value and manually toggling SUEnableAutomaticChecksKey / calling setAutomaticallyChecksForUpdates: will toggle update checking as well, right?

That's correct. It's just that in our apps we have a single popup for the update preference, which would not be possible with 1.5b5.

Generally it's a bad idea to reduce possibilities, and even worse to be incompatible with previous settings. E.g. users who have disabled updating (based on 1.1) will have their check interval set to zero. If I would switch to 1.5b5 now, those users would check for update very often rather than never. That's seriously wrong. And Sparkle has currently no way (or even API) to fix that.

Can you help with this problem?

Provide an answer of your own, or ask livings124 for more information if necessary.

To post a message you must log in.