How do I modify the install directory on windows to a path above the default ${platform_install_prefix}?

Comments

4 comments

  • Avatar
    wojciechka

    You can simply reuse the <preInstallationActionList> action from that answer which sets the installation directory. In this case it would be:

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

    which will set the installation directory to C:/apps, D:/apps or other disk depending on which drive is the system drive.

  • Avatar
    courtenayt

    That's great. Thank you!

  • Avatar
    DominikS

    As I see this breaks --prefix switch. Is it possible to add some rule to detect --prefix is not used?

  • Avatar
    DevHopeful_2012

    To add on to wojciechka's answer, if you don't want to affect the user's ability to override the default, via --prefix or the UI, then use a <initializationActionList> to initialize the installdir with a reasonable default.

Please sign in to leave a comment.