Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 4.3.1
-
Fix Version/s: None
-
Component/s: Installer
-
Labels:None
-
Patch Submitted:Yes
-
Number of attachments :
Description
For some of my projects i need to have a different defaultinstallation path depending on conditions so I ca use something like
<variables>
<variable name="ST_PROFILE" value="PRO"/>
<variable name="DesktopShortcutCheckboxEnabled" value="true"/>
<variable name="INSTALL_PATH" value="$
{APPLICATIONS_DEFAULT_ROOT}${FILE_SEPARATOR}ST_MEXICO_PRO" condition="C_PROF_PRO"/><variable name="INSTALL_PATH" value="${APPLICATIONS_DEFAULT_ROOT}
$
{FILE_SEPARATOR}ST_MEXICO_CAP" condition="C_PROF_CAP"/>
</variables>
The following code that must replace the method TargetPanel.panelActivate
implements this requirement:
/**
- Called when the panel becomes active.
*/
public void panelActivate() { String defaultInstallDir; super.panelActivate(); com.izforge.izpack.util.VariableSubstitutor vs = new com.izforge.izpack.util.VariableSubstitutor(idata.getVariables()); defaultInstallDir = vs.substitute(getDefaultInstallDir(), null); setDefaultDir(defaultInstallDir); idata.setInstallPath(defaultInstallDir); // Set the default or old value to the path selection panel. pathSelectionPanel.setPath(idata.getInstallPath()); }
I need about the same feature but with a list of choice.
What we want to do is to have a costum list field (a list of environnment ex: DEV, TEST, PRE_PROD, PRODUCTION with default value=DEV)
this value is then put in a variable ex name="ENV_CHOICE"
And when this fields is selected force the default installation path to include a suffix or prefix to the path
<variable name="INSTALL_PATH" value="$
{APPLICATIONS_DEFAULT_ROOT}${FILE_SEPARATOR}${ENV_CHOICE}" />or
<variable name="INSTALL_PATH" value="${ENV_CHOICE}${FILE_SEPARATOR}${APPLICATIONS_DEFAULT_ROOT}
" />
Or add a feature that let us overide the default install path at any time in the configuration process.
thank