2014-01-15

My company produces a small suite of Eclipse RCP applications that are installed into the same shared location on Windows (C:\Program Files (x86)\MyCompany). They share a plug-ins directory but have separate configuration areas.

The desired location for osgi.configuration.area, osgi.user.area, and osgi.instance.area are in a user's roaming application data area (%APPDATA% on Windows XP/7). Due to localization requirements and differences in path locations between the OSes, it is not sufficient to build a path in the PRODUCT.ini launcher file starting from @user.home. Bug 241192 added the ability to specify environment variables in the config.ini file, but not in the PRODUCT.ini file.

This is the installation directory structure:

This is an example PRODUCT.ini file:

This is an example config.ini file:

If the working directory is in installation directory when the application is launched (e.g. double-click the exe in Windows Explorer, use a shortcut with the "Start in" variable defined as the installation directory), the relative path for osgi.baseConfiguration.area is resolved to the correct absolute path and osgi.configuration.area is set to the correct location in APPDATA. If the working directory is not the installation directory (e.g. open the application by double-clicking a file in Explorer associated with the program, launch from the command line from any non-installation directory), the program launches but osgi.baseConfiguration.area is still listed as a relative path and osgi.configuration.area reverts to its fallback position (for admins: C:/Program Files (x86)/MyCompany/configuration, for users: %USERPROFILE%/.eclipse/configuration). osgi.user.area and osgi.instance.area are correctly set in both instances.

My custom local configuration (configurationProgram1/config.ini) is clearly found, otherwise the application would fail to launch at all. However in the problem case, the Equinox launcher is either ignoring my osgi.configuration.area declaration or resetting it. I do not know how to step through the Equinox launcher start up class (org.eclipse.equinox.launcher.Main) to diagnose the problem further. The correct behavior is observed if osgi.baseConfiguration.area is defined as an absolute path rather than a relative path.

The RCP applications are based on Eclipse Platform 3.8.1. I confirmed the problem still exists in version 3.8.2, the last release of the 3.x branch. Upgrading to the e4 platform is not a viable option at this time, but I would be interested in knowing if this issue is fixed in e4.

I realize my shared installation for multiple application is a unique case as the assumptions for a shared installation appear to be a single application with multiple local configurations for users and a single shared configuration. Still I suspect this is an Equinox bug; however, I wanted to ask the community whether I have misconfigured my installation or have misunderstood the documentation with regard to these osgi properties before doing so.

Show more