osgi.baseConfiguration.area does not resolve using a relative path [message #1231890] |
Wed, 15 January 2014 17:12 |
Steven Darnell Messages: 19 Registered: November 2010 |
Junior Member |
|
|
My company produces a small suite of 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:
C:/Program Files (x86)/MyCompany
configurationProgram1/config.ini
configurationProgram2/config.ini
configurationProgram3/config.ini
jre/
plugins/*.jar
Program1.exe
Program1.ini
Program2.exe
Program2.ini
Program3.exe
Program3.ini
This is an example PRODUCT.ini file:
--launcher.defaultAction
openFile
-clean
-vmargs
-Xmx768m
-Dosgi.locking=none
-Dosgi.requiredJavaVersion=1.7
-Dvisualvm.display.name=Program1
-Dosgi.baseConfiguration.area=file:configurationProgram1
-Dosgi.sharedConfiguration.area=file:configurationProgram1
This is an example config.ini file:
#Product Runtime Configuration File
eclipse.application=com.mycompany.app.program1.application
osgi.bundles.defaultStartLevel=4
eclipse.product=com.mycompany.app.program1.product
osgi.splashPath=platform:/base/plugins/com.mycompany.app.program1
osgi.bundles= ...
org.eclipse.equinox.common@2:start,\
...
org.eclipse.equinox.launcher.win32.win32.x86,\
org.eclipse.swt.win32.win32.x86
osgi.configuration.area=$APPDATA$/MyCompany/Program1/configuration
osgi.user.area=$APPDATA$/MyCompany/Program1/user
osgi.instance.area=$APPDATA$/MyCompany/Program1/instance
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.
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.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02921 seconds