Question

Q: How do I specify a different default installation directory for Unix and Windows?

For example: What should I do if I want to set in Unix a different default installation directory than the one used in Windows?

Answer:

Let's say you want to use c:myapp-4.0 for Windows and /usr/local/myapp-4.0 for Unix as the default installation directory. In InstallBuilder, go to "Advanced", locate the 'installdir' parameter under 'Parameters' (or create a new directoryParameter named 'installdir'), edit it and specify /usr/local/${product_shortname}-${product_version} as Installation Directory. Now go to the "XML Editor" tab and insert this code:

<preInstallationActionList>
          <setInstallerVariable>
            <name>installdir</name>
              <value>${env(SYSTEMDRIVE)}/${product_shortname}- ${product_version}</value>
              <ruleList>
                <platformTest>
                  <type>windows</type>
                </platformTest>
              </ruleList>
          </setInstallerVariable>
        </preInstallationActionList>
        

Remember that if you choose /usr/local as the destination for your application you have to require that the installation is performed as the root user. ${product_shortname} and ${product_version} are installer variables. You can find the complete list of the default installer variables available and their meaning in the product documentation included with InstallBuilder.