I'm a C# developer and actually i have to develop some functions in Java 1.6 for an OpenOffice-PlugIn. One of these functions is to get some meta informations of environment like the version of the executing OpenOffice. On Google i didn't find something. I know that a registry entry exists. But that is just a subkey without a value. Does anybody know, how i can get the Version Number of the executing OpenOffice with Java 1.6?
Edit:
Now i have the solution. I will help other developer, if they have the same issue. It must be only capsuled in a method.
XComponentContext componentContext = com.sun.star.comp.helper.Bootstrap.bootstrap();
XMultiComponentFactory xRemoteServiceManager = componentContext.getServiceManager();
Object configProvider = xRemoteServiceManager.createInstanceWithContext( "com.sun.star.configuration.ConfigurationProvider", componentContext);
XMultiServiceFactory xConfigProvider = (XMultiServiceFactory) UnoRuntime.queryInterface( XMultiServiceFactory.class, configProvider);
PropertyValue[] lParams = new PropertyValue[1];
lParams[0] = new PropertyValue();
lParams[0].Name = "nodepath";
lParams[0].Value = "/org.openoffice.Setup/Product";
Object xAccess = xConfigProvider.createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess" , lParams);
XNameAccess xNameAccess = (com.sun.star.container.XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, xAccess);
String OOVersion = (String)xNameAccess.getByName("ooSetupVersion");
return OOVersion;