Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » My update site does not work very well...
My update site does not work very well... [message #1125371] Fri, 04 October 2013 12:48
Nicolas Sanchez is currently offline Nicolas SanchezFriend
Messages: 3
Registered: October 2013
Junior Member
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:


  1. 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?

  2. 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 :
    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...

  3. Update action : I've added a p2.inf file in MyFeatureProduct project and add it in the build.properties file :
    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:
    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.

[Updated on: Mon, 07 October 2013 11:42]

Report message to a moderator

Previous Topic:java.lang.RuntimeException: Application "id" could not be found
Next Topic:How to create TreeViewer with Action/Handler
Goto Forum:
  


Current Time: Fri Apr 26 12:45:23 GMT 2024

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

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

Back to the top