RCP Self Provisioning with P2: It Works!!!
I finally could create the mail demo RCP app using p2 to update itself!
My environment is Windows Vista, Java 6, Eclipse 3.4 RC4.
Here are the steps that describe how I p2-enabled the mail demo:
1. Created the mail demo (project p2-maildemo)
2. Created a product configuration p2-maildemo.product
3. Added 3 plug-ins to both launcher and product configuration (and added required plug-ins)
To get the final update work in the installed product, it is also necessary to include the following 3 plug-ins with dependencies in the product configuration:
4. Exported the product and the metadata/artifact repositories to c:/java/RCP/p2-maildemo
5. Used the director app to install the mail demo from the repository, with the following Program arguments:
6. Started the installed mail demo in c:/java/RCP/p2-maildemo/install
7. Selected Help/Software Updates…: Showed the P2 UI with installed Product in version 1.0.0
So far so good!
Now I wanted to create a new version 1.0.1 of the product and update the installed version 1.0.0:
8. Updated main mail demo plug-in to version 1.0.1
9. Updated product version to 1.0.1
10. Exported the new product version 1.0.1 in the SAME location, to update the metadata/artifact repositories.
The first thing I noticed was that my installed 1.0.0 did not find any update. I thought, when the installation repository contains a new version, this would be seen by my application without any extra configuration.
11. So I added the repository c:/java/RCP/p2-maildemo/repository manually as a new site, and voila, the new version 1.0.1 was displayed and ready for update.
12. When I wanted to install the update, the P2 dialog told me correctly: “RCP Product is already installed, so an update will be performed instead.”
13. And now, when I clicked finish, the update was actually happening, the new version was installed properly!!!
I am so happy that I finally got this to run 🙂
What would be the best practice to create a list of artifacts/metadata repositories in the configuration/.settings/org.eclipse.equinox.p2.metadata.repository.prefs and org.eclipse.equinox.p2.artifacts.repository.prefs to include the real update sites for the product?
Many thanks to everybody who helped me.