Uploaded image for project: 'IzPack'
  1. IzPack
  2. IZPACK-456

Allow changing the default install path using conditions

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 4.3.1
    • Fix Version/s: None
    • Component/s: Installer
    • Labels:
      None

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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:

                Time Tracking

                Estimated:
                Original Estimate - 3 days
                3d
                Remaining:
                Remaining Estimate - 3 days
                3d
                Logged:
                Time Spent - Not Specified
                Not Specified