Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Self-updating an RCP application(How to update an RCP application that contains an updatable plugin)
icon6.gif  Self-updating an RCP application [message #663114] Sun, 03 April 2011 18:19 Go to next message
Zooks  is currently offline Zooks Friend
Messages: 11
Registered: April 2011
Junior Member
I am very new to RCP and would really appreciate some help. I am using Helios.

I have a plugin "x" that is being updated via an "x.feature" feature.
I have an RCP app "Y" that has a product definition that requires "x.feature".
I want to deliver both the plugin and the RCP app to different users, but I want both to be updated automatically when new versions get released.

Questions
1. Is the RCP app a plugin itself? I assume yes, I know it is a plugin project.

2. When we say that the RCP app is capable of self-updating, can it actually update the RCP functionality (i.e., the app can change title, add a new About Dialog, a new menu item, etc)?

3: If I want the RCP app "Y" to be self-updated, do I need to create a new feature project "Y.feature" and add 'x.feature' as an included feature?

4: If the answer to 3 is yes, do I need to set up 2 different update sites, the one just updating x.feature and the other updating Y.feature which includes x.feature? Will that force x.feature to be updated?

To summarize, do I need two different feature projects and two update sites/p2 repos?

Thank you very much.
Re: Self-updating an RCP application [message #663241 is a reply to message #663114] Mon, 04 April 2011 12:20 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

If you provide x.feature, and people install it, they can update when
you provide a new version.

For the RCP app, it becomes slightly different. Is x.feature an add on,
or fundamental to your RCP app?

If it's fundamental the most common practice is to release the new
version of y.product built with the new version of x.feature ...
updating the product version and x.feature version at the same time.

If it is not, or is part of a 3rd party feature that you consume (not
really yours, you have a couple of options):

1) don't make it part of your y.product, install it afterwards.

2) make it semi-optional [1] and a top level IU (a director install of
x.feature will make it a root-IU, even if it is already included in
y.product).

[1] there's a extra step to allow x.feature to be updated under
y.product. See http://aniefer.blogspot.com/ one of the blogs discusses
how to update a feature that's included as part of a product.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Platform_Expression_Framework
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Re: Self-updating an RCP application [message #663367 is a reply to message #663241] Mon, 04 April 2011 19:25 Go to previous messageGo to next message
Zooks  is currently offline Zooks Friend
Messages: 11
Registered: April 2011
Junior Member
Thank you for your reply Paul. It was really helpful. Very Happy

x.feature is fundamental to my RCP app - my RCP app would be meaningless without it. So according to your suggestion I need to do the following:

1) Use an update site for x.feature for people that install it in Eclipse.

2) Whenever there is a new version for x.feature, I will take this version and create a new product version for Y.feature (RCP app). This means that I will need a separate update site for the RCP app (the updated via the Y.feature).

3) My Y feature.xml should include x.plugin and Y.plugin as required but should not list y.feature in the required features. Is this correct?

As for my other question, I did realize that the RCP app project is itself a plugin. But when we say that the RCP app is capable of self-updating, can it actually update the RCP functionality (i.e., the app can change title, add a new About Dialog, a new menu item, etc)? Does it force an application restart?

Thank you!
Re: Self-updating an RCP application [message #663418 is a reply to message #663114] Mon, 04 April 2011 23:15 Go to previous messageGo to next message
Richard Adams is currently offline Richard AdamsFriend
Messages: 77
Registered: July 2009
Location: Edinburgh
Member
Yes, you can update the functionality - but UI changes might not take effect until you restart the application after updating. One exception is if the feature you're updating contains a bundled JRE, the update fails on Windows as it tries to delete a running instance of the JRE.

The Eclipse MacAffer RCP book ( at least the old edition) had an example application structure which we've followed in our RCP app which works quite well.
E.g.,

essentialPluginA in
essentialFeatureA
- containing your core functionality.

productPluginA in
productFeatureA
-containing application specific classes such as WindowAdvisor, Application, + core menus.

productPlugin also contains a feature based .product file which lists the above features + Eclipse features (p2, rcp etc).
So, because the product plugin is wrapped in a feature, you can update the things you mentioned and keep your functionality in a product-agnostic plugin.

We have the same issue- a plugin which is key to our app and included in the product build, but which is independent of the product, so we'd like to make available to other RCP apps - despite much wresting with p2 we've concluded we need two update sites, one for the app and one for 'just' the feature - but possibly someone with more p2 expertise may have a solution for this.

Best wishes

Richard




Re: Self-updating an RCP application [message #664446 is a reply to message #663418] Fri, 08 April 2011 22:00 Go to previous messageGo to next message
Zooks  is currently offline Zooks Friend
Messages: 11
Registered: April 2011
Junior Member
Hello Richard,
Thank you very much for your reply. It helped straighten some things out.

I can build and install the productPluginA, with the configuration: essentialPluginA, essentialFeatureA and ProductPluginA. The app installs and runs fine when I use the useFeatures=false flag, but when I try to set the flag to useFeautres=true my pde build succeeds but the app does not launch. The errors vary: usually(for different tweaks on the build) I get the "application was not found in registry" type of error.
If I cannot use the useFeatures=true my understanding is that I cannot use features to update using p2, is that correct?

I also have read all kinds of different ways to set up my app for updates, none of which worked for me (faced different issues for each approach) and ultimately I am really confused.
One approach suggests to use the org.eclipselabs.p2 plugin and feature, others to just add org.eclipse.equinox.p2.user.ui feature (I was not able to fix my product to run with features so both approaches failed).

My target platform is 3.5. I use the following build properties:
eclipse.build.xml.dir=${eclipse.dir}/plugins/org.eclipse.pde .build_3.5.2.R35x_20100114/scripts
eclipse.launcher=${eclipse.dir}/plugins/org.eclipse.equinox. launcher_1.0.201.R35x_v20090715.jar

When I tried to just add p2-related plugins to my .product when I launch the application I get this error:
!STACK
java.lang.RuntimeException: Could not find framework
at org.eclipse.equinox.launcher.Main.getBootPath(Main.java:880)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:498)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)

The plugin dependencies that were added in my .product are:
<plugin id="org.eclipse.equinox.p2.ui"/>
<plugin id="org.eclipse.equinox.p2.ui"/>
<plugin id="org.eclipse.equinox.p2.ui.sdk"/>
<plugin id="org.eclipse.equinox.p2.ui.sdk.scheduler"/>
<plugin id="org.eclipse.equinox.p2.updatechecker"/>
<plugin id="org.eclipse.equinox.p2.updatesite"/>
<plugin id="org.eclipse.update.core"/>
<plugin id="org.eclipse.update.ui"/>

Do I need to absolutely have useFeatures=true to make my product/RCP app self-updatable?

What is the best way to add the Install New Software and Check for updates menu items in my RCP app?

In the meantime I will start again from scratch and try to follow this example for a 3rd time:
http://www.ralfebert.de/blog/eclipsercp/p2_updates_tutorial/

Thanks again.
Re: Self-updating an RCP application [message #665199 is a reply to message #664446] Wed, 13 April 2011 15:54 Go to previous message
Zooks  is currently offline Zooks Friend
Messages: 11
Registered: April 2011
Junior Member
It looks like our headless PDE build is very complicated. We decided to start over using an open source example that works with p2, get the headless build going and then gradually swap it out carefully with our plugins. I hope this approach works and helps somebody else that may have similar issues building an update-able RCP app through a headless build.

Thanks.
Previous Topic:RCP + Webstart
Next Topic:Show text under icon in perspectivebar
Goto Forum:
  


Current Time: Fri Apr 26 17:36:02 GMT 2024

Powered by FUDForum. Page generated in 0.04194 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top