title: How to get hold of AutomatedInstallData within IzPack 5 InstallerListener methods?
body: <p>I've tried to find any info on that but failed, maybe someone here can help.</p>
  
  <p>I'm using IzPack 5 since couple of weeks and that's what I started with, so I have no prior IzPack 4 experience.</p>
  
  <p>What I want to do is the following:</p>
  
  <ol>
  <li>Give the user an opportunity to select data directory via
  UserInputPanel (works fine) </li>
  <li>Validate the entry by checking if the
  database already resides there (works fine) </li>
  <li>Depending on whether
  the DB already exists and if "force" flag specified on the
  UserInputPanel create the database after the packs have been
  installed</li>
  </ol>
  
  <p>This last step, that's what I can't see how to do.</p>
  
  <p>I hava a java class that implements InstallerListener interface:</p>
  
  <pre><code>public class IzPackInstaller implements com.izforge.izpack.api.data.DynamicInstallerRequirementValidator,
   com.izforge.izpack.api.event.InstallerListener {
  </code></pre>
  
  <p>It's the same class I use for both data validation / db existance check on step 2 and creation on step 3, just for convinience reasons, but it shouldn't matter</p>
  
  <p>I override </p>
  
  <pre><code>@Override
  public void afterInstallerInitialization(AutomatedInstallData data)
          throws Exception {
      System.out.println("Called afterInstallerInitialization");
      System.out.println("db.location=" + data.getVariable("db.location"));
      System.out.println("db.force.creation=" + data.getVariable("db.force.creation"));
  }
  </code></pre>
  
  <p>but it seems to be deprecated alltogether and is never called in runtime - checked with System.out's.
  The same is valid for:</p>
  
  <pre><code>@Override
  public void afterPacks(AutomatedInstallData data,
          AbstractUIProgressHandler handler) throws Exception {
      System.out.println("Never called!");
  }
  </code></pre>
  
  <p>I also override</p>
  
  <pre><code>@Override 
  public void afterPacks(List&lt;Pack&gt; packs, ProgressListener listener) { }
  </code></pre>
  
  <p>which is called allright, but how to get hold of AutomatedInstallData within this method? Or how else can I read installer variables at this stage? </p>
  
  <p>I thought of creating a singleton, which I would initialize with the variables during DynamicInstallerRequirementValidator.validateData() call and get the variables at a later point in time, but it's ugly and sounds like a nasty workaround - there should be a way to implement InstallerListener interface and be able to use the variables, shouldn't it?</p>
  
  <p>I'd be really grateful for any hints...</p>
  
  <p>Anton</p>