I have created an installer which copies a config.ini and asks the user for values which are then inserted into the ini file. This works fine during a fresh install and major/minor upgrades.
<Component Id="ConfigIni" Guid="GUID-GOES-HERE" DiskId="1">
<File Id="ConfigIniFile"
Name="config.ini"
Source="../../artefacts/etc/template-config.ini"
KeyPath="yes"/>
<IniFile Id="ValueOne"
Action="addLine"
Directory="ETC"
Section="sectionone"
Name="config.ini"
Key="valueone"
Value="[VALUEONEPROPERTY]" />
<IniFile Id="ValueTwo"
Action="addLine"
Directory="ETC"
Section="sectiontwo"
Name="config.ini"
Key="valuetwo"
Value="[VALUETWOPROPERTY]" />
</Component>
However, if a user tries to install the same version of the product which is already installed, the installer enters repair mode. I'm not sure how repair mode works, but in the case of the config.ini file, it seems to be deleting the one with populated values, copying it again, and because it's a repair it's not got any user values to populate the config.ini file with, so the file is blank.
Is there any way of getting the installer to ignore this file on repair, or get the original user values?