Actually you can't change this using ANT. However, as you already know the deploy mechanism uses Inno Setup and you can modify its behaviour.
During the fx:deploy
ANT task a default ApplicationName.iss
file is created. This default file contains e.g. the setting, which is responsible for the install directory. This default file is only created, if you don't provide any customized on your own. So, I would recommend to run the ANT script, copy the default file and modify it. If you enable the verbose
flag of the fx:deploy
task you can use the console output to find out, where the default file is created and where the ANT task searches for your customized file before creating the default one:
<fx:deploy
...
verbose="true">
<fx:info title="${appname}" vendor="${vendor}"/>
...
</fx:deploy>
In my case I found the default file in
C:\Users\gfkri\AppData\Local\Temp\fxbundler3627681647438085792\windows
and had to put the customized file to
package/windows/ApplicationName.iss
relative to the ANT build script.
If you got so far, you'll find the line DisableDirPage=Yes
in your ApplicationName.iss
file. Change it to DisableDirPage=No
and the user gets the possibility to change the install directory.
Further you will find the parameter DefaultDirName
. If you want to install your Application to C:\Program File\ApplicationName
by default you can use the constant {pf}
e.g.: DefaultDirName={pf}\ApplicationName
.