I have an MSI (built with Wix 3) already distributed to customers. Among others, the product has a directory named Reporter
that contains two files, A and B.
A is the implicit KeyPath
, because it is the first entry in the XML.
For security reasons, we need to eliminate file A. So we need to produce an MSI that:
- does not contain A
- on upgrade, removes A, but keeps file B (in the same component, in the same directory)
- on clean install, deploys only B (obviously)
Here is the current WXS file:
<Directory Id="DirX" Name="Reporter">
<Component Id="componentX" Guid="47A2D991-AC4D-43C0-94F3-02E3D4D2AB3D" DiskId="1" Win64="yes">
<File Id='A' Name='A' Source='A'/>
<File Id='B' Name='B' Source='B'/>
</Component>
</Directory>
<Feature Id="featureX" Title="bla" Level="1">
<ComponentRef Id="componentX" />
</Feature>
How can one reasonably accomplish this? Remarks:
-
no we cannot keep file A
-
it would be very nice to keep file B in the same directory (
Reporter
) -
we usually perform minor upgrades
-
we don’t really care about features or components, the product is usually installed as a whole by network admins, without user interference.
I tried everything I could find on the internet:
- setting file B as KeyPath -> on upgrade, the entire directory
Reporter
is wiped. - creating a new feature, new component, new GUID, with only file B -> on upgrade, the entire directory
Reporter
is wiped. - using RemoveFile for file A -> same result
I am reluctant to create a custom action, but will do if that is the only way.
3