I'm trying to update our RCP application so that it uses P2 to install and uninstall packaged features and plugins (in a zip file). So far I've got the basic mechanism working but I have a problem that I need help with:
Moving or renaming the RCP app installation folder is a requirement, as the user may re-installs the app into a different location or simply want to move it to a different location.
However, if the user renames or moves the installation folder of the RCP application then the P2 information in the configuration area no longer matches the path to the installation folder and uninstalling or re-installing features/plugins leads to errors.
Our RCP *.ini file sets the configuration area on Windows as follows:
-Dosgi.configuration.area=@user.home/AppData/Roaming/Archi4/.config
The RCP config.ini is as follows:
eclipse.p2.profile=profile
osgi.framework=file\:plugins/org.eclipse.osgi_3.13.200.v20181130-2106.jar
equinox.use.ds=true
ds.delayed.keepInstances=true
osgi.bundles=reference\:file\:org.eclipse.equinox.simpleconfigurator_1.3.200.v20181101-1115.jar@1\:start
org.eclipse.equinox.simpleconfigurator.configUrl=file\:org.eclipse.equinox.simpleconfigurator/bundles.info
eclipse.product=com.archimatetool.editor.product
osgi.splashPath=platform\:/base/plugins/com.archimatetool.editor
osgi.framework.extensions=reference\:file\:org.eclipse.osgi.compatibility.state_1.1.300.v20181116-1550.jar
osgi.bundles.defaultStartLevel=4
eclipse.p2.data.area=@config.dir/../p2
eclipse.application=com.archimatetool.editor.app
The following scenario is is where the problem accurs:
1. User installs the RCP app to C:\Archi
2. User installs a new feature using our P2 mechansism.
3. The following folders are then written to or updated in the @user.home/AppData/Roaming/Archi4/ folder:
.config
| org.eclipse.core.runtime
| org.eclipse.e4.ui.css.swt.theme
| org.eclipse.equinox.app
| org.eclipse.equinox.simpleconfigurator
| org.eclipse.osgi
| org.eclipse.update
| .baseConfigIniTimestamp
| config.ini
| eclipse.ini.ignored
features
| com.example.feature
p2
| org.eclipse.equinox.p2.core
| org.eclipse.equinox.p2.engine
plugins
| com.example.plugin
4. User moves the RCP app to C:\AnotherFolder
5. User now tries to uninstall the feature using P2 but the P2 ProfileChangeOperation Status is "Failed to find a configured bundleInfo for: [R]com.example.pluginname"
6. User now tries to re-install the feature using P2, Status is OK but now the app will not start. The *.log message written in .config folder contains errors such as
org.osgi.framework.BundleException: Could not resolve module: com.example.pluginname [1]
Unresolved requirement: Require-Bundle: org.eclipse.help.ui
How can I set things up so that this doesn't happen?
[Updated on: Wed, 06 March 2019 22:33]
Report message to a moderator