Question

I have a variable="name" in my userInputSpec.xml . I use it to create the directory inside installation. $INSTALL_PATH/${name}

I want to remove the spaces supplied in the name before it triggers the installpanel. I do not want to restrict the user to enter the spaces.

Was it helpful?

Solution

In IzPack 5.0, you might use dynamic variables with a regexp filter for it, see http://docs.codehaus.org/display/IZPACK/Dynamic+Variables:

<conditions>
  <condition id="nameIsSet" type="exists">
    <variable>name</variable>
  </condition>
</conditions>

<dynamicvariables>
  <variable name="name.nospace" value="${name}" checkonce="true" condition="nameIsSet">
    <filters>
      <regex regexp="\s+"
             replace=""
             defaultValue="${name}"
             global="true"/>
    </filters>
  </variable>
</dynamicvariables>

In this case, ${name.nospace} might be the variable to reuse, which would be set once the ${name} variable is set (and never changed after that).

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