Two days ago I needed to create a small demo of updating an RCP application using the Update Manager as a part of the presentation I was doing on Eclipse technology. The point was to show how easy it is to update an existing application by downloading a new feature from the update site.
Since the point of the demo was the update process, I chose a simple plugin example called the "Intro". For a "new feature" that will be added, I wrote a small plugin that contributes a single menu item that would appear after the update is performed. When clicked, it displays a message box that declares that the demo has succeeded. Nothing fancy, but it illustrates the point.
All went well for a while. I used a nice tutorial to create an update site, at this point as a local directory, and published there my new feature. I also manually contributed a "Software Updates" submenu (the "Help" menu already existed in the example) and delegated the operation to the UpdateManager class as demonstrated in this article (.pdf).
And then the problem began. I would not install my feature. Whenever I checked my feature on the update site, and error status would float up declaring that "Resulting configuration does not contain the platform." Mmm, that's strange. Last time I checked the platform was alright...
Not having a clue what that meant, I tried to Google my way out of it, but it did not work out very well. A first search discovered that this specific error is either very rare, or extremely unpopular. In any case I did not find a quick fix, nor after hours of playing with configuration, adding and removing plugins from features and dependencies. It just would not install my feature.
I will make the long story short. I really should have read my tutorials thoroughly. In the RCP tutorial is clearly says that "If your product needs automatic update, then eventually you should convert it to use features." And I didn't even look in this tutorial since I thought I know what I'm doing.
Well, when I converted my RCP to use features instead of plugins the update finally succeeded. As an extra "bonus", since I included platform and RCP features, I have received the "Search" and "Run" menus, as well as another "Software Updates" submenu. Now I had two update menus when I only needed one and two additional menus I did not need at all! I was able to get rid of the search menu by removing the search plugin and I also removed my "update" menu contribution. I have decided to leave the "Run" menu and not waste time on removing it programmatically. I hope it will be easier in 3.3 :)
The paradox of insular language
2 years ago