Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » P2 » P2 profile is not updated after install operation via standard p2 API
P2 profile is not updated after install operation via standard p2 API [message #1009044] Thu, 14 February 2013 10:35
Ulyana Tsyukh is currently offline Ulyana TsyukhFriend
Messages: 6
Registered: December 2011
Junior Member
I have a product which already has a mechanism of 'Checking for Available Updates' on startup using standard p2 Operations API. It works fine and can resolve all the dependencies (like which updates are installed and which are not), if new updates are available it will download them correctly.

Currently I am implementing similar functionality of 'Check for Available New Installs' on startup using same Operations API and my code looks the following:


InstallOperation install = new InstallOperation(provisioningSession, toInstall); 
IStatus status = install.resolveModal(null);
if (status.getSeverity() == IStatus.OK) {
    Job job = operation.getProvisioningJob(null);
    job.schedule();
}



My problem is that after I install new bundles (only visible after restart of the application) I would like to check that they are already installed, I use the standard API for that:


IProfileRegistry profileRegistry = (IProfileRegistry) provisioningAgent.getService(IProfileRegistry.SERVICE_NAME);
IProfile profile = profileRegistry.getProfile(IProfileRegistry.SELF); 
Collection<IInstallableUnit> alreadyInstalled = profile.available(QueryUtil.ALL_UNITS, null).toUnmodifiableSet(); 



But it doesn't include my newly installed bundles. Another strange observation that my application would try to install the same bundles all the time because InstallOperation resolves to OK as if those bundles were never installed (I assume that is because they are not actually included in the current profile, same result as I get when listing all installed bundles from the current profile, see code above).

So my question is why the bundles that get installed using standard p2 Operations API do not get registered as part of current profile (even though I can see they are copied and installed in my app correctly).

The Operations API:
http://help.eclipse.org/helios/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fp2_api_overview.htm

[Updated on: Mon, 18 February 2013 08:40]

Report message to a moderator

Previous Topic:Ant task p2.mirror seems to leave out dependency
Next Topic:Shared install: private plug-ins not showing up
Goto Forum:
  


Current Time: Thu Apr 25 23:37:36 GMT 2024

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

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

Back to the top