HOWTO: Use the p2 director to control where you install
A number of people have remarked to me that there’s a very important feature missing in Eclipse 3.4 Ganymede’s p2 Update UI, which they consider a regression from Eclipse 3.3 Europa’s Update Manager UI.
Specifically, the feature — introduced in Eclipse 3.1? — that allows users to choose where to install a new feature, rather than the default eclipse/features/ and eclipse/plugins/ folders.
The simplest hack available to get this option back is to use the Update UI to install what you want into Eclipse, then go move all the newly created files in eclipse/features/ and eclipse/plugins/ into a new folder. You’ll know which ones are new (and therefore safe to move) because they’ll all share the current timestamp, whereas the base Eclipse install will have its earlier timestamp. Kludgy, perhaps, but it works.
But, you say, surely there’s a better way? Yes, there is. It’s the p2 director.
Here are two ways to install a feature using the p2 director: one installing directly into the dropins folder, and one installing into any folder on your drive, then LINKED from dropins using a .link file. Yes, .link files still work.
Should you want to script the installation of a feature into the eclipse/ root folder (ie., for building a product, perhaps?) you can use this third script to reuse the existing SDKProfile. The added benefit is that only the single feature you chose to install shows up in the Help > Software Updates... Installed Software dialog, rather than ALL the subfeatures required or contained by that feature. It’s a little cleaner, but you’re back to the “everything in eclipse/plugins/ and eclipse/features/” scenario — though for a product, or “all-in-one” bundle, like the Standalone BPMN Modeler that’s probably better than spread around the disc.
- Install into eclipse/ using SDKProfile
(the p2 Update UI’s default behaviour)
Got a few minutes to try this? Then why not contribute your own example (eg., for Windows or Mac), for your project?

July 11th, 2008 at 07:06 pm
Thanks Nick!
As for the BPMN modeler we have asked to have it packaged as an EPP. I’ll compare both procedures and will let you know which one is the best to create a product.
July 13th, 2008 at 03:47 pm
Well, that is all nice and dandy. But won’t updates to the installed plugins/features be put into the main installation as opposed to in the linked folder (As mentioned in bug 230373 - https://bugs.eclipse.org/bugs/show_bug.cgi?id=230373)? Making the entire performance irrelevant as you are forced to ‘clean up’ every time there is an update.