IzPack
  1. IzPack
  2. IZPACK-456

Allow changing the default install path using conditions

    Details

    • Type: Improvement Improvement
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 4.3.1
    • Fix Version/s: None
    • Component/s: Installer
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      0

      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()); }

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Carlos Valenzuela
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - 1 day
              1d
              Remaining:
              Remaining Estimate - 1 day
              1d
              Logged:
              Time Spent - Not Specified
              Not Specified