Question

I am working on custom installer for JAVA Swing based application with IZpack.This java application makes use of 3rd party external DLL's.The path of DLLs is mentioned in property files.By reading this property file DLLs were loaded into the application with system.load() functionality.Now I m using IZ pack installer to create installer for my application. This installer dumps all the DLLs into the installation directory choosen by the user.Now I have to move that path of the DLLs which was hardcoded in the property file to the installation directory. I need help in this regard. Thanks, SK

Was it helpful?

Solution

This can be achieved by using IzPack variables in your property files and include those files into one of the pack as parsable.

Example, let's say there is file application.properties with a line dll.path=${localSettingsDir}${FILE_SEPARATOR}dlls, where ${localSettingsDir} should be a variable declared in your install.xml. This can be done as following:

<dynamicvariables>
    <variable name="localSettingsDir" value="$localSettingsDirUi" />
</dynamicvariables>

Here $localSettingsDirUi is a variable specified for a field on a custom panel. This way if a corresponding field is changed then variable $localSettingsDirUi changes and variable localSettingsDir is also update dynamically.

Then in one of your packs in install.xml you need to put something like this:

<packs>
  <pack name="Your Pack" required="yes">
     ...
     <file src="application.properties" targetdir="$INSTALL_PATH" />
     <parsable targetfile="$INSTALL_PATH/application.properties" type="javaprop"/>
     ...
  </pack>
  ...
</packs>

That should be it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top