Since OO 3.x, several environment variables must be set: UNO_PATH env. variable and the class path set to the folder where the DLL are located
This has been done so far without problem for a machine where the OO installation is well known. However,we wish to distribute this application as a WebStart app within our organisation, thus, cannot ensure the where OO has been installed.
Since we can retrieve the registry keys (Layers\URE\1 - UREINSTALLLOCATION and UNO\InstallPath) to find out the location from inside the applciation, the remaining difficulty is how to carry this information to the OO part we call.
The initialization is done within a lazy intializer as follows:
Code: Select all
public static synchronized OpenOfficeContext getContext() throws OpenOfficeException {
if (context == null) {
try {
context = new OpenOfficeContext(Bootstrap.bootstrap());
} catch (BootstrapException e) {
throw OpenOfficeException.wrap(e);
}
}
return context;
}Cheers,
Didier