I have a WiX installer which needs to install new bits for Interop.FOOBARLib.DLL to the GAC. The problem is that the version number is the same as the old version and the new bits do not get written the GAC on an upgrade. We execute the RemoveExistingProducts action after the InstallFinalize action.
We cannot move the RemoveExistingProducts action to earlier in the install.
The foobar.dll component is not my component so I cannot increment the type library version (which would cause the version of the interop to increment and all these problems go away).
Is there a way to FORCE the file to be upgraded in the GAC even if the version is the same? I want behavior similar to “gacutil.exe /f”.
The component looks like:
<Component Id="Interop.FOOBARLib.dll" Guid="{4E0C173E-34DF-4249-A3A6-5530047FA65B}" >
<File Id="Interop. FOOBARLib.dll" Name="Interop.FOOBARLib.dll" KeyPath="yes" Assembly=".net"/>
</Component>
What you're trying to do is called an In-Place update of an Assembly in the GAC. For this to work correctly both Interop.FOOBARLib.dll libraries must have the same assembly version, but the newer dll must have a higher file version. The file version attribute must be included in the new MSI's MsiAssemblyName table. Wix does not include this attribute by default, so you have to add the following parameter to your .wixproj file:
<SetMsiAssemblyNameFileVersion>True</SetMsiAssemblyNameFileVersion>
See also:
In-place updating using Wix
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With