How to disable plugin auto update programmatically?

Hello guys,

Is it possible to enable/disable plugin auto update programmatically? We want to deliver some plugin updates on the paid basis, so after the free updates period is over it would be nice to disable auto update functionality for the plugin.
If not, then what is the right way to implement "paid updates" for a plugin?

Thank you for support!

4 comments
Comment actions Permalink

Disabling the auto updates (even if it was possible) would not solve the problem, because the users will still be able to install the new version of the plugin from disk. You need to implement a licensing system to verify that the license key used by the user is compatible with the installed version of the plugin.

0
Comment actions Permalink

Thank you, Dmitry, for the quick response!

Yes, of course we should to verify the compatibility of the license key with the current plugin version. And we already do that (Every plugin release "know" about when it was released, so we compare that date).
The question is how to avoid the plugin update if user don't want to pay for upgrade? Maybe he want to stay on the old version forever?
In our view it would be nice to ask him before the update was heppened: "New version of the plugin is available now. But your free updates period is over. Do you want to update plugin anyway?"
or "New version of the plugin is available now. Do you want to purchase the upgrage license?" or something like that.


If it is not possble then the only solution I see is to "restore" the plugin jar to old version when the update suddenly happened...
But this solution is ugly because tomorrow the update will happen again.

Сan you suggest a better solution?

Thank you for support!

0
Comment actions Permalink

Turns out there is in fact an API for that: UpdateChecker.getDisabledToUpdatePlugins().add("ID of your plugin")

This set is persisted between restarts of IntelliJ IDEA.

0
Comment actions Permalink

Thank you, Dmitry, that's exactly what I was looking for!

0

Please sign in to leave a comment.