1

We have an installation script written in install4j.

Our installer needs to call custom code from the library jniwrap.dll. We included jniwrap.dll into the install4j project and declared it in 'Installer' > 'Custom Code & Resources'.

Unfortunately the installation fails: jniwrap.dll cannot be loaded because it's not in the search path.

Do you know how the error can be fixed? What about the jniwrapper's license file? Do we have to insert it to the install4j project, too?

Thank you in advance.

andreasgk
  • 673
  • 1
  • 12
  • 30

1 Answers1

0

Unfortunately the installation fails: jniwrap.dll cannot be loaded because it's not in the search path.

The parent directory of the extracted file will not be in the search path. You have to call

System.load((String)context.getVariable("sys.resourceDir") 
    + File.separator + "jniwrap.dll");

to load the library.

What about the jniwrapper's license file? Do we have to insert it to the install4j project, too?

If it needs to be in the same directory as the DLL, then yes.

Ingo Kegel
  • 46,523
  • 10
  • 71
  • 102