Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » Triggering an Uninstallation of a Feature While Installing Another Feature via Touchpoint Actions
Triggering an Uninstallation of a Feature While Installing Another Feature via Touchpoint Actions [message #1160888] Tue, 29 October 2013 08:24 Go to next message
Johnny Mongiat is currently offline Johnny Mongiat
Messages: 7
Registered: December 2009
Junior Member
Hello,

Is it possible to uninstall a specified feature while installing/upgrading another feature (all done as a single step)?

For example, suppose an RCP application currently has feature com.foo.feature installed. Now a user wants to upgrade the RCP application, so they add a software site (i.e. the RCP application includes provisioning support via the UI) which points a p2 repository that contains the newer versions of existing features, say com.bar.feature, but not com.foo.feature (this is no longer applicable i.e. deprecated), and goes through the standard "Check for Updates". Is it possible to trigger the uninstallation of com.foo.feature during the update process?

I took a look at the p2 touchpoint actions documentation (http://help.eclipse.org/kepler/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/p2_actions_touchpoints.html), and noticed the org.eclipse.equinox.p2.touchpoint.eclipse.uninstallFeature action, but I'm not entirely clear on it's usage. I tried the following:

com.bar.feature:
- p2.inf has the following instructions.uninstall=org.eclipse.equinox.p2.touchpoint.eclipse.uninstallFeature(feature:com.foo.feature.feature.group,featureId:com.foo.feature,featureVersion:1.0.0);

But I'm not sure if this is correct - I'm thinking this may get triggered during the uninstallation of com.bar.feature itself (I want to trigger the uninstallation of com.foo.feature during an upgrade of com.bar.feature). Perhaps I need to "bind" to another phase other than uninstall?

Logically, I would want the following to occur during the "Upgrade" process:
1. Uninstall com.foo.feature
2. Install/upgrade com.bar.feature (and other features...)

Note, I know the user can manually perform the above steps via the p2 UI infrastructure itself:

1. Help > About
2. Click on the "Installation Details" button.
3. Under the "Installed Software" tab, select the com.foo.feature feature node.
4. Click on the "Uninstall..." button.
5. Follow the uninstall directions to complete the uninstallation, and make sure to restart the RCP application when complete.
6. After restart, select Help > Install New Software...
7. Add the p2 upgrade repository (as an Available Software Site)
8. Close the Install wizard.
9. Help > Check for Updates
10. Review/Accept the selected features that will be updated, and complete the update process by following the directions provided by the wizard.
11. After another restart, you should be good to go!

This is an acceptable process, but I'm really curious if the process can be condensed as previously described.

Thanks.
Re: Triggering an Uninstallation of a Feature While Installing Another Feature via Touchpoint Action [message #1166069 is a reply to message #1160888] Fri, 01 November 2013 15:09 Go to previous messageGo to next message
Pascal Rapicault is currently offline Pascal Rapicault
Messages: 283
Registered: July 2009
Location: Ottawa
Senior Member
p2 does not deal with features directly. The features you see on disk are here for legacy purpose instead of being here for driving anything real. What you want to do needs to happen during the dependency resolution "phase" (which is done before any of the touchpoint instruction comes into play).

In order to do this you just need to indicate that the feature com.bar.feature is an update of the com.foo.feature. This can be done by setting the update descriptor to capture this information. Unfortunately the PDE editors don't support this natively so you will have to resort to use a p2.inf in the com.bar.feature. The p2.inf should contain something like that:

update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'com.foo.feature' || pc.name == 'com.bar.feature'))

HTH,

Pascal
Re: Triggering an Uninstallation of a Feature While Installing Another Feature via Touchpoint Action [message #1170511 is a reply to message #1166069] Mon, 04 November 2013 12:54 Go to previous message
Johnny Mongiat is currently offline Johnny Mongiat
Messages: 7
Registered: December 2009
Junior Member
Asked, and answered!!! Specifying an update descriptor advice is exactly what should be done (ref: http://wiki.eclipse.org/Equinox/p2/Customizing_Metadata). Thanks Pascal!

Just to reiterate, adding the following to the com.bar.feature's p2.inf will accomplish
the original intent:

update.matchExp=providedCapabilities.exists(pc | pc.namespace == 'org.eclipse.equinox.p2.iu' && (pc.name == 'com.foo.feature.feature.group' || pc.name == 'com.bar.feature.feature.group'))
Previous Topic:Hide features on update-site from showing up in a older version of Eclipse
Next Topic:Customizing binary files
Goto Forum:
  


Current Time: Tue Jul 22 11:39:34 EDT 2014

Powered by FUDForum. Page generated in 0.04822 seconds