I have an install that includes some database files, mdf & ldf.
The install for years has had the mdf files flagged as key files.

The company now wants the ability to move these database files to a different location, outside of the install.
If they do this, when the user starts the application it goes into repair mode and adds the database files back due to resiliency.

So I thought, why not just remove the key file flag for each of the components that include a mdf and ldf file.

The problem, the primary database that includes customer information now gets overwritten. The component id remains the same. The flags for never overwrite and permanent are the same. However, the setup clearly overwrites the mdf and ldf file of that component.

The only solution that comes to mind is to add a system search that sets a property that indicates that the database is installed and then set a condition on the component to only install if this condition is false.

Is there a better way for me to handle this?