Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force installer to upgrade a file in the GAC regardless of the version number

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>
like image 951
Mike Avatar asked Nov 25 '09 15:11

Mike


1 Answers

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

like image 86
Douglas Mendizábal Avatar answered Oct 19 '22 14:10

Douglas Mendizábal