I didn't like the default installdir value so I started using my own by overriding them (see snippet below).
But now I lost the --prefix functionally in an unattended installation, can I use my own default installdirs which are different for each platform yet allow it to be overruled when --prefix is used?
Hi @truhlik_fredy,
You could check that the value of installer_command_line_arguments does not contain prefix:
<preInstallationActionList>
<setInstallerVariable name="prefixSet" value="1">
<ruleList>
<compareText text="${installer_command_line_arguments}" logic="contains" value="prefix"/>
</ruleList>
</setInstallerVariable>
</preInstallationActionList>
Then you can use the prefixSet value to conditionally set the installdir:
<setInstallerVariable>
<name>installdir</name>
<value>${env(SYSTEMDRIVE)}/${project.vendor}/${product_shortname}-v${product_version}</value>
<ruleList>
<platformTest>
<type>windows</type>
<isTrue negate="1" value="prefixSet"/>
</platformTest>
</ruleList>
</setInstallerVariable>
Would that work for you?
Regards,
Michiel
Thank you very much @michieldhont_
It almost worked straight away out of the box, made only 2 small changes, moved the condition outside the platform test and used variable syntex for the prefixSet and now it does exactly what I was hopping for: