|RE: [p2-dev] Follow up: Updating to a certain version|
I’m sending you an example of our updater.
The repository is a System property. You can construct it another way that suits you.
If you have questions, I will be happy to help.
2010/5/17 Yaneva, Elena <elena.yaneva@xxxxxxx>
Maybe what you can do is create an update plan, yourself and pass it directly to the P2 engine in order the update to be performed.
IEngine engine = (IEngine) agent.getService(IEngine.SERVICE_NAME);
In order to create the plan, you need to get the InstallableUnit(your product) both from the profile and from the repository and decide, whether to add it to the plan for update or no(based on the versions).
IProvisioningPlan plan = engine.createPlan(profile, provisioningContext);
If this approach is ok for your scenario, I can send you how I have done It in our Updater.