try {
// redirect izPack output to file
PrintStream ps = new PrintStream(openOutputStream(buildOutputFile), true, "UTF-8");
System.setOut(ps);
File installFile = null != installConfigFile ? installConfigFile : new File(izpackDir, "izpack.xml");
CompilerConfig compilerConfig = new CompilerConfig(installFile.getAbsolutePath(), izpackDir.getAbsolutePath(), "standard", izpackOutputFile.getAbsolutePath(), izpackCompress, null);
CompilerConfig.setIzpackHome(izpackDir.getAbsolutePath());
compilerConfig.executeCompiler();
} finally {
System.setOut(console);
}
}