Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

P2 Install Example

Revision as of 14:31, 29 July 2008 by Jeff.Hamm.sas.com (Talk | contribs) (Exporting)

Set up P2 Eclipse Environment

  • Get p2 from CVS

To get started, you will need the source code for p2. This is best done by following the steps outlined at Equinox p2 Getting Started for Developers

  • Create RCP Application

We want to create an RCP Application through the 3.4 Eclipse SDK so that we have something to publish thereby creating a local artifact and metadata repository that th p2 tools can use. To do this,

From Eclipse, File->New->Other
Select Plug-in Project
Specify a project name (com.eclipse.cosmos.testp2app)
Click Next
Select Yes for Create a Rich Client Application
Click Next
Choose RCP Application with a View

Once you click Finish, this will create a MAINFEST.MF file and open the file in the eclipse viewer window.

  • Test RCP application from MANIFEST.MF file.

To test the application, from the Overview tab click the Launch an Eclipe application button. This should launch the application and you will get a window displayed of your test application.

Set up Product

  • Create Product Configuration

The product configuration is used to specify the necessary bundles that the application relies on so that it can perform the necessary dependency checks and have the components available when it runs. To do this,

From Eclispe, highlight the plugin project (com.eclipse.cosmos.testp2app) that we created.
Select from the menu bar File-New->Product Configuration
Specify a filename. (testp2app)
Click Ok.

This will display the testp2app.product edit page.

From the testp2app.product edit page, we will now specify the product definition.

Enter a name (testp2)
For the id, select New button. From dialog, click Ok.
Enter a version (1.0.0)
  • Specify Configuration

Now we will add the bundles necessary.

From Configuration tab, click add.
In the Add dialog, right click and select all.
Click Ok.

This will add the bundles necessary to run the app. Make sure and save the testp2app.product file (ctrl-s) or your application will fail the next test.

To make sure all of this is working, from Overview tab, select

Synchronize
Launch eclipse application

This will again verify that that the application runs using the specified product configuration.

Exporting

We can now export our application and create a local metadata and artifact repository from the data. To do this we will use the Eclipse Product export wizard available from the product configuration page. (testp2app.product)

From the blah.product, select export wizard from Export column tab area.
Specify a destination directory (C:\equinox.p2\local
Check the Generate Metadata repository checkbox.
Click Finish.

This will generate a local metatadata and artifact repository in the specified destination directory.

Running ProvAdminUI

To run the admin ui, select the Run icon in the toolbar and select the pulldown. This will display the configurations avalable. Select the Run Configurations... option at the bottom.

From the Run Configurations page, select the OSGI Framework ProvAdminUI. You may need to click the Add Required Bundles button. Click the Run button.

This will run the Admin UI.

First we will need to specify the metadata repository. Highlight the Metadata Repositories tab. In the window, right click and select Add..

specify metadata repository

From the dialog, click the Local button and browse to the location specified for the destination in the previous Product export step. Be sure and select down and include the repository directory. To verify, expand the repository you added and you should see your application.

specify artifact repository

To specify an artifact repository, select the Artifact Repositories tab and right click in the window. In the window, select Add.

From the dialog, click the Local button and browse to the location specified for the destination in the previous Product export step. Be sure and select down and include the repository directory.

specify profile In the Admin UI, the lower window is where you specify Profiles. Right click in the window and select Add Profile. In the dialog, Specify a unique profile id. Specify an install folder. This is where the application will get installed. Specify a Bundle pool location . Simply use the same area. Specify a name.

Click Ok.

Install our applicaiton. drag and drop application to profile.

Hightlight in the metadata tab your application and then drag and drop it to the profile entry.

You will see a Resolving dependencies dialog pop-up and then disappear. Then you will see an Install window with your application shown and a checkbox beside it. Click Finish.

To verify, browse to the profile directory and run the eclipse.exe there. You should see your application run.

Run the application we created

  • Browse to the profile directory
  • run eclipse application.

Use the Installer

  • create a run configuration
  • point to the destination directory of the product export
  • point to the profile
  • run application
  • select an install directory location
  • click Install

Back to the top