I am using Wix for creating an .msi for my installation. I want to keep a config file when the msi installer does a major upgrade.
This are the relevent parts from my Product.wxs file: My upgrade attribute:
<MajorUpgrade
Schedule="afterInstallInitialize"
DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
And the component that by my understanding should prevent the removal of my config file:
<DirectoryRef Id="INSTALLFOLDER">
<Directory Id="Content" Name="Content">
<Component Id="Config" Guid="432FF769-1011-47CF-BFFD-0BF780768C45">
<File Source="$(var.MO.Packing.Wpf.TargetDir)\Content\StationConfig.xml" Name ="StationConfig.xml"
Id="config" KeyPath="yes" />
</Component>
</Directory>
</DirectoryRef>
Adding my Feature attribute incase it is relevent:
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
...
<ComponentRef Id="Config" />
...
</Feature>
In creating this logic I followed this guide: http://blogs.msdn.com/b/astebner/archive/2008/10/19/9006538.aspx
Also read some other questions and sources: How to keep a config file when major upgrade in wix v3.8?
https://msdn.microsoft.com/library/aa371197.aspx
and some more...
Can anyone identify the problem?
I would add any other relevant data to my question if necessary.
Any help is appreciated!