How to Push NetBeans Plugins Silently to End Users?
By Geertjan-Oracle on Jun 03, 2010
The scenario is that you have end users who are either (1) not very technical or (2) too busy to use the Plugin Manager, yet you need to distribute new features to them anyway. Or maybe the user has logged in or has paid a special fee for the "professional" version of the software and now additional modules should be made available to them, without them needing to use the Plugin Manager. Short of walking around to all their work stations (kind of tricky if you've created a commercial application bought by 1000s of users off the shelf) and manually installing new features on your own... how do you update the installations of your application? Not a problem if you're using JNLP, i.e., Java WebStart, seeing as you're in control of JNLP applications, since they're on the server. However, let's say you're not using JNLP, how do you solve this problem?
When asked this question, we always refer to the NetBeans Auto Update Services API, which gives you access to a Java API for managing distributions of features, however you'd like that to be done. But, what about an example covering the most typical scenarios?
The related engineer, Jiri Rechtacek, i.e., the AutoUpdate guru on the NetBeans team, has now made a complete sample available, as described here:
Install the sample described in Jiri's blog entry and then you have the Silent Update sample available:
Next, work through that wizard, shown above, and you'll be asked to provide, among other things, a URL to your update center. I made a small demo update center here, which anyone is free to reuse:
Then, once I had completed the wizard, I added the module to my demo RCP application... I then deployed the application... and then... within a few seconds (based on the code in the sample) the modules from my small demo update center above were silently added to the application! I.e., one window and one toolbar button below appeared magically, without me, as the user, doing anything at all, I didn't even need to restart the application:
Both updates to existing modules and completely new modules are installed automatically, silently, without needing to do anything at all from the user side and without me doing any coding at all, i.e., I simply used the sample installed via Jiri's blog. In this scenario, no Plugin Manager is needed at all, hence no "Plugins" menu item is available under the Tools menu and you, as the provider of the application, have control over the distribution of features to installed applications. By providing the "Silent Update" module in your application, you enable the application to poll your update center at a time of your choice (daily, weekly, at startup, when the user has given you all their money, whatever) for updates and new features for your application... and then, changes having been detected in the update center, the changed/new plugins are installed automatically. Great work Jiri!