views:

319

answers:

2

I am preparing windows installer for my Eclipse plugin. I want install it into target eclipse product using P2 director. I am targetting only Eclipse 3.5 for now.

Installer should check that prerequisite features/plugins are already installed. I am not sure how to do this check. (Other reason for this check is to choose what other features to install, as I will bundle some prerequisites in the installer).

Easy solution is to look into eclipse/features/ and eclipse/plugins/ directories, but plugins may be installed elsewhere too: dropins directory and linked via links directory.

I would like to get list of installed fetures and plugins from P2 (profile?), if possible. Is there any way to do this? Any better solutions?

+1  A: 

Have a look at the P2 agent, it does what you are after. Browse the source code to see how it interacts with the repository. You can use the p2 director to streamline the actual installation.

The Equinox Incubator also has a number of useful links

Rich Seller
Thank you. I spent some time reading about P2 at eclipse Wiki, and it is starting to make sense to me. I even found what I was looking for ... almost :-)
Peter Štibraný
A: 

At http://wiki.eclipse.org/Equinox_p2_Getting_Started, they talk about eclipse/configuration/org.eclipse.equinox.simpleconfigurator/bundles.info file:

The file bundles.info contains a list of all the plug-ins installed in the current system. On startup, all the plug-ins listed in this file are given to OSGi as the exact set of plug-ins to run with. Any extra plug-ins in the plugins directory or elsewhere are ignored. ... However, it's useful to know about this file so you can see exactly what is installed in the system you are running.

Well, it's not list of features, but list of plugins is good too.

Peter Štibraný
Beware of orphan plugins though, they can cause problems for your install as P2 likes all plugins to be managed by features. See http://stackoverflow.com/questions/1200202/how-to-find-orphan-plugins-in-eclipse-rcps
Rich Seller