How to handle updates that depend on license?

Asked by Mark Roseman

I want to support the scenario where users can purchase a license (of say, 1.0) and that gets them all 1.x updates for free, but there'd be an upgrade price to move to 2.x versions.

The license encodes the information about what major versions it supports. If they've got a v1 license, we want them to be able to update as normal to 1.x upgrades. If a 2.x upgrade is available, we want them to know about it (and nag them to purchase an upgrade license), but not let them perform the upgrade - or at least warn them that their license doesn't cover the upgrade.

We have another app (not currently using Sparkle) where the license encodes a "covers one year of updates" policy; this would be another example where the above approach would be useful.

What would be the recommended way to implement this? Which delegate methods or other hooks should I be looking at?

Question information

Language:
English Edit question
Status:
Solved
For:
Sparkle Edit question
Assignee:
No assignee Edit question
Solved by:
Hofman
Solved:
Last query:
Last reply:
Revision history for this message
Best Hofman (cmhofman) said :
#1

I'd say you should implement at least -bestValidUpdateInAppcast:forUpdater: and select the update item yourself. You may also use different appcasts for the different licenses, and call -setFeedURL: at an early stage.

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

This is kind of tricky. Obviously, Sparkle shouldn't be in the business of dealing with your licensing system, but optimally, it *should* provide hooks that would let you do this kind of thing.

You can use the delegate method Hofman suggests to deal with the "covers one year of updates" issue.

Then to finish it, you need to make the update alert take your users to the web site on certain kinds of updates instead of actually performing the update. Sparkle doesn't support that, but you could probably make the modification pretty readily: take a look at SUUpdateAlert.

Revision history for this message
Mark Roseman (mark-markroseman) said :
#3

Thanks guys... I'll have a look at the areas you suggest (though might not be able to get to it immediately). I definitely agree that Sparkle shouldn't do more than providing the necessary hooks... will let you know how this all works out.

Revision history for this message
Mark Roseman (mark-markroseman) said :
#4

Thanks Hofman, that solved my question.