I'm using WIX to code my installer. The application being installed has a database file that needs to be removed only upon uninstallation, and not touched in case of a repair, reinstallation or an upgrade.
I coded it as such:
<Component Id='CompIDRemDataFile' Guid='{---gui--}'>
<RemoveFile Id="idRemDataFile" Name="program_database.db" On="uninstall" Property="MyDataFolderPath" />
<RegistryValue Id="RegRemDataFile" Root="HKCU" Key="Software\My Company\App name"
Name="11352" Value="1" Type="integer" KeyPath="yes" />
But I just learned that if I upgrade from an older version to a later one, this file is also deleted. What shall I change to prevent that?