Wednesday, December 20, 2006

The Update Manager and the RCP

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 :)

3 comments:

Anonymous said...

Hi,

Can you please tell me how you removed the "Search" and "Run" menus on the menu bar? Please be as specific as you can.

Thanks,
Kevin

Anjur Chan said...

"Resulting configuration does not contain the platform" slowed down my development cycles :(. Finally your post triggered my brain and I have it working now :)

Keep writing about such corner cases find in eclipse RCP platform.

Thanks,
Chandran AN.

iamchating said...

Hi

I have also met a problem on this topic. I have developed an RCP Application, which allow the user create their own project and. One import requirement for my application is to support the user to use a code repository (CVS, SVN or so) to control the source of their own project. For there may be several different types of version control systems, and I can not pack the plug-ins (e.g. Subeclipse) into my application due to copyright issues, my idea is that I can open the eclipse update manager to the user and allow user to install their own plug-ins.
I have followed the instructions in the EclipseCon2005_Tutorial8 and added the install and update actions. When I tested the installation any update site (Mylyn,Subeclipse even my own testing update site)using the update manager in my RCP application, I always get the same error as you met. “Resulting configuration does not contain the platform”.
I am new to Eclipse development, and I do not quite understand “find out that for your Update Manager to work properly you need to have everything as a feature and no-plug-ins”. How to do this?
My Application has the following structure:
Eclipse Plug-in Project A (so called PluginA)
Eclipse Plug-in Project B (so called PluginB)
RCP Product Project (so called product project)
The actual business logic is all in PluginA and PluginB, the product project contains just a few initialization code and the configuration files for the RCP application.
My product configuration is based on the “Plug-in” but not “feature”. And currently it references about 500 plug-ins. I do not know how to change it to the “feature” configuration.


Thanks you for your help, and can you get in touch with me by the mail address “tantian$$$gmail.com” ( please replace the $$$ with @)?