Developers, Developers, Developers! Maksim Sorokin IT Blog

31Mar/11Off

Building IzPack installers on the fly

One can grab ideas on how to build IzPack installers on the fly from izpack-maven-plugin.

You will of course need to depend on IzPack standalone compiler.

Basically, what do you need to do is to have some directory for staging. This is useful, when you want to run some filtering or putting some additional resources from somewhere else to the installer. You can use %TEMP% directory (File.createTempFile(...)) for that. Do not forget to wipe it afterwards!
When you have all your installer resources in some staging directory and you know the direct path to your install.xml you are ready to build a installer:

CompilerConfig compilerConfig = new CompilerConfig(installXmlPath, stagingDirPath, null, targetFilePath);
compilerConfig.executeCompiler();