Prevent WiX from removing/replacing file from older installation

Viewed 5488

I'm in the process of upgrading an old Visual Studio setup project installer to a WiX installer.

I have a problem with the new installer though - it keeps removing a config file that was installed with the old installer.

The component in the .wxs file looks like this:

<Component Id="MyConfig" NeverOverwrite="yes" Permanent="yes">
  <File Id="MyApp.exe.config" Name="MyApp.exe.config" />
</Component>

I tried setting the component Id and Guid to the same as they were in the old installer, but then it replaces the existing config file with the new one - which I don't want, as the config file may have been modified since the initial installation.

What I want, is if MyApp.exe.config is already installed it should not be removed or replaced.

1 Answers
Related