How Deliver RCP Patches and Updates ??


I have been working on an RCP application delivered to internal customers inside my (big) company during the last months. I already have a satisfying headless build for this application, generating a full package as a zip archive that is already delivered to the previously mentioned internal customers as release 0.9.6 (several releases have been done).

We plan now to deliver the 1st (1.0.0) “official” release for the beginning of the 2011. In this context we are thinking about the best strategy to handle updates and patches that will be done on top of this 1.0.0 release. To better understand the context here is the RCP product’s content:

  1. org.eclipse.rcp feature provided by the Eclipse Foundation
  2. my.company.generic feature provided by an other team in my company and delivered as P2 repository.
  3. my.company.product feature wrote by myself.

Our requirements regarding the updates/patches installation are the following ones:

  1. User must update the RCP application as a global action and doesn’t care which feature among the 3 features of the product is updated/patched
  2. Some users have access to our (through internal network) P2 update/patches repository and others don’t
  3. It’s not yet possible to add new optional “software” (features in Eclipse’s terminology) to the product

To handle the 1st requirement I decided to adopt the same policy to update OR to patch the product with increment of the product version. Each time the product feature (2) OR the product required feature (3) I’ll will upgrade the product version number, the product feature (2) number if this is the modified feature and I’ll perform a full rebuild of the product and update the p2 repository with the result of this build.

Regarding requirements number 2, I maintain an up to date p2 repository for users having access to it and provide a zipped version of the same repository each time it is updated for other. This solution will work but will enforce users without access to the repository to get a full zipped archive each time the product is updated even if for example only the required feature (2) is modified. Can you see a better solution to handle this situation ?

For the last requirement, I decided to not use the P2 UI and write my own update UI code as mentioned in this Eclipse wiki. It seems not so easy but feasible.

Feel free to tell us about your RCP’s experience regarding updating and patching by commenting this post,

Manuel

Advertisements

2 thoughts on “How Deliver RCP Patches and Updates ??

  1. We addressed this issue in Eclipse 3.4 with the “Eclipse update” mecanism.

    The update occurs during the application startup : it updates all features from an update site.

    Here is the code snippet :
    [UpdateAction.java]
    public void run(IProgressMonitor monitor) {

    URL siteUrl = new URL(EasyParameters.getInstance().getUpdateSite());
    // remote site
    ISite rs = SiteManager.getSite(siteUrl, monitor);
    // local site
    ILocalSite ls = SiteManager.getLocalSite();
    IInstallConfiguration backupConf = ls.getCurrentConfiguration();

    // extract install operations to do by comparing versions between distant and local sites
    List installOps = new ArrayList();
    checkConfiguration(ls, rs, installOps, monitor);

    // apply install operations
    try {
    for (IInstallFeatureOperation installOp : installOps) {
    installOp.execute();
    }
    } catch (Exception e) {
    // …and do some rollback on error
    ls.save();
    IRevertConfigurationOperation op = OperationsManager.getOperationFactory().createRevertConfigurationOperation(backupConf, null);
    try {
    op.execute();
    } catch (Exception e) {
    /// TODO: rollback can fail if file removal is not allowed.
    }
    ls.save();
    }

    }

    Notes :
    – checkConfiguration: browse distant and local sites to find and compare features. Create install operations to do.
    – doInstall : execute each install operation with installOp.execute();

    This is certainly NOT the way to do updates because it relies on internal APIs. But maybe the same process can be done with p2 without those (ugly) tricks ?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s