Hello,

First of all, I'm sorry for my poor english, I hope it will be understandable.

I have done an RCP application (based on Eclipse Indigo SR2) that contains several features:
- MyFeatureProduct (with following features in dependencies)
- Feature1
- Feature2
- Feature3

I have configured my application to make it updatable following this tutorial : first link if you google "p2_updates_tutorial_36".

So, my questions and problems:


I have added MyFeatureProduct product feature in the site.xml file, but I don't know if it is a good way. I've done it because if new feature appears, it need to be visible in the install wizard, but the MyFeatureProduct must be updated too. Is it good?

Install action : my action open the install wizard, I configure my update site location and all the features does appear. I hide already installed feature with the checkbox, and only the Feature1 1.0.1 is selectable => it's ok. But when I click the next button, I've the following error message :
Java Code:
    Your original request has been modified.
       "Feature1" is already installed, so an update will be performed instead.
    Cannot complete the install because of a conflicting dependency.
      Software being installed: Feature1 1.0.1 (my.feature1.feature.feature.group 1.0.1)
      Software currently installed: MyFeatureProduct 1.0.0 (my.myfeatureproduct 1.0.0)
      Only one of the following can be installed at once: 
        Feature1 1.0.0 (my.feature1.feature.feature.jar 1.0.0)
        Feature1 1.0.1 (my.feature1.feature.feature.jar 1.0.1)
      Cannot satisfy dependency:
        From: MyFeatureProduct 1.0.0 (my.myfeatureproduct 1.0.0)
        To: my.feature1.feature.feature.group [1.0.0]
      Cannot satisfy dependency:
        From: Feature1 1.0.0 (my.feature1.feature.feature.group 1.0.0)
        To: my.feature1.feature.feature.jar [1.0.0]
      Cannot satisfy dependency:
        From: Feature1 1.0.1 (my.feature1.feature.feature.group 1.0.1)
        To: my.feature1.feature.feature.jar [1.0.1]
I thought that it was because MyFeatureProduct version was always 1.0.0 so I've added a 1.0.1 version to the site.xml file and built it, but when I try again to update MyFeatureProduct and Feature1 from 1.0.0 to 1.0.1 version, I have the same error (but on MyFeatureProduct now).
I really don't know what is the problem...

Update action : I've added a p2.inf file in MyFeatureProduct project and add it in the build.properties file :
Java Code:
    instructions.configure=\
      org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:0,location:file${#58}/C:/path_to_my_update_site/);\
      org.eclipse.equinox.p2.touchpoint.eclipse.addRepository(type:1,location:file${#58}/C:/path_to_my_update_site/);
When I try to update => No update has been found.
So I've added the following code in ApplicationWokbenchAdvisor::postStartup:
Java Code:
    public static String configureRepositoryManager(final String repo) {
            final ProvisioningSession session = ProvisioningUI.getDefaultUI().getSession();
            final RepositoryTracker repoMan = ProvisioningUI.getDefaultUI().getRepositoryTracker();
            if (repo == null || repo.isEmpty()) {
                if (repoMan != null) {
                    repoMan.removeRepositories(repoMan.getKnownRepositories(session), session);
                    repoMan.clearRepositoriesNotFound();
                }
                return null;
            }
            URI uri = repoMan.locationFromString(repo);
            if (uri == null) {
                return getI18N().getString("error.malformed.uri.repository");
            } else {
                if (uri.getScheme() == null || !uri.getScheme().equals("http")) {
                    try {
                        uri = repoMan.locationFromString("file://" + repo);
                        uri.toURL();
                    } catch (MalformedURLException e) {
                        try {
                            uri = repoMan.locationFromString("http://" + repo);
                            uri.toURL();
                        } catch (MalformedURLException e1) {
                            // Error
                            return getI18N().getString("error.malformed.uri.repository");
                        }
                    } 
                }
            }
            repoMan.removeRepositories(repoMan.getKnownRepositories(session), session);
            repoMan.clearRepositoriesNotFound();
            repoMan.addRepository(uri, "My application repository", ProvisioningUI.getDefaultUI().getSession());
            return null;
        }
When I try to update => No update has been found.
Any idea?



Now I'm going to try to override getProvisioningUI().openUpdateWizard and getProvisioningUI().openInstallWizard, but I don't think that it is a good idea...

Thanks in advance for your help.