Reputation: 16815
According to this, to retain user-customized files during a Windows Installer major upgrade I need:
1. Place each .config file in its own component and mark the .config file as the key path of the component.
2. Schedule the RemoveExistingProducts action in the new version of your MSI after the InstallFiles action.
<Component Id='config.json' Guid='GUID'>
<File Id='config.json' Name='config.json' DiskId='1' Source='config.json' KeyPath='yes' />
</Component>
...
<InstallExecuteSequence>
<RemoveExistingProducts Before="InstallFiles"/>
</InstallExecuteSequence>
There is following warning during build:
warning LGHT1076 : ICE63: Some action falls between InstallInitialize and RemoveExistingProducts.
There is following error during installation:
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2613.
What is wrong?
Upvotes: 0
Views: 329
Reputation: 55601
The simplest way to handle this problem is to design your application so that user modified data is in it's own files. This way the installer can then own the files it lays down and the application can merge the two sets of data at runtime. MSI won't delete or overwrite what it doesn't know about.
Otherwise you get into complicated discussions of how to merge xml/json and other file types during an upgrade.
Upvotes: 1