I am working on a project where I need to handle version downgrades of System.IO.Compression.Native.dll in an MSI installer. This issue was discussed on GitHub, where it was suggested to use the CompanionFile feature of WiX to resolve version conflicts.
GitHub Issue for Reference:
Steps to Reproduce:
- Create a new .NET 6 application.
- Publish the app as a self-contained application.
- Bundle the application as an MSI file using the WiX toolset.
- Repeat steps 1-3 for .NET 7.
- Upgrade the MSI from .NET 6 to .NET 7, leading to the missing System.IO.Compression.Native.dll issue.
Workaround:
The suggested workaround is to use the CompanionFile feature of WiX. Specifically, to configure System.IO.Compression.dll to be the companion to System.IO.Compression.Native.dll.
Problem:
I understand that I need to set the CompanionFile attribute, but I am using the harvesting feature of WiX, which automatically generates the component and file XML elements. As a result, I am unable to directly edit these elements to add the CompanionFile attribute.
Questions:
- How can I configure the CompanionFile attribute for files that are automatically harvested in a .wixproj file?
- Is there a way to modify or extend the harvested output to include the necessary CompanionFile attribute?
References:
Any help or guidance on how to handle this situation would be greatly appreciated!
Based on the discussion, I know the configuration should look something like this if I could edit the XML directly:
<Component Id="Comp_Compression" Guid="*">
<File Id="System_IO_Compression_dll" Source="@(Path to System.IO.Compression.dll)" KeyPath="yes" />
<File Id="System_IO_Compression_Native_dll" Source="@(Path to System.IO.Compression.Native.dll)" CompanionFile="System_IO_Compression_dll" />
</Component>
However, I need to achieve this configuration while using the harvesting feature.