Here's an example snippet. It plugs the values into the file, but only if they are authored into the Property table and it ignores any values that are set or modified during execution:
<Component Id="postgresql.conf" Guid="*">
<File Id="postgresql.conf" KeyPath="yes" Source="postgresql.conf" />
<SystemTools:TemplateFile Id="postgresql.conf" Source="[#postgresql.conf]" Target="[#postgresql.conf]" ExecuteOnInstall="yes">
<SystemTools:TemplateFileProperty Id="port" Name="port" Value="[PORTPOSTGRESQL]" />
I sequence a custom action to run early on to set this property to something different than the default. I can see in the MSI log that this property changes. When the immediate mode TemplateFile CA runs, I can see XML being stored in the custom
action data, which contains the original value of my property, not the value I just updated it to.
I'm using this with WiX 3.6 beta by the way, which is probably not supported.