Search code examples
javaosgieclipse-rcp

Unbundle Bundle-NativeCode at install time for Eclipse RCP


Dynamic libraries can be included inside Eclipse plug-ins, referenced with Bundle-NativeCode in MANIFEST.MF, and automatically extracted at runtime to a temporary, user-writable location.

There are some security concerns with copying executable code at runtime to a user-writable location.

Is there a way to instead install them already extracted, alongside the application, and use these installed, unzipped DLLs instead?

Is there a way to do this without installing as unzipped every bundle that includes a DLL?


Solution

  • I don't think you can do this using Bundle-NativeCode.

    You could do something like the SWT code which uses System.loadLibrary.

    You can include the libraries in a directory in the RCP install using the root directive in a feature build.properties. Your plugin can use Platform.getInstallLocation to find the install location.