0

I have a .NET DLL named A.dll version 3.303.1.1.
I got a new A.dll with a patch but it has the same version 3.303.1.1 which I need to provide with the upcoming versions of my application.

What I need to do is to force replace the old A.dll by the new patched A.dll from GAC during setup. I am using Installshield to create the installer.

The DLL is a third party DLL needded by the application. Also the File version for the old DLL is 3.303.1.1; but for the new DLL it is 3.3.1.1.

The assumption is that the old versions of the application are still installed and should remain while we use the new setup to install the new version application.

So the old version also should point to the new dll A.dll.

How can I customize the setup using Installshield(2011) to achieve the behavior?

My trials: When I simply added the new DLL to the setup and tried installing it in a machine where the old version of application was already installed, the new DLL was not installed in the GAC as the version of both the DLLs are same. However, when I used GACUTIL.exe to force install the new DLL, I was able to do so and the old DLL was replaced by the new DLL in the machine.

Thank you.

SujanKh
  • 21
  • 4

1 Answers1

0

Rebuild the DLL with an incremented AssemblyFileVersion but the same AssemblyVersion and InstallShield / Windows Installer should automatically do what you are looking for.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • The DLL is a third party DLL. So I cannot rebuild it :D. Is there any way to change the AssemblyFileVersion? – SujanKh Jan 03 '13 at 03:22
  • Are you telling me a third party delivered two strong named DLL's with the save AssemblyVersion and AssemblyFileVersion but different implementation? Can you make them fix it? That contributes to DLL hell that the GAC was designed to prevent. – Christopher Painter Jan 03 '13 at 12:57
  • The AssemblyVersion is same but AssemblyFileVersion is different. The DLL that is to be installed into GAC has smaller file version than the DLL already present in the GAC. Using GACUtil I was able to force install the DLL but I could not do it using Installshield. – SujanKh Jan 04 '13 at 11:30
  • So did you stop reading my answer at the word "rebuild"? When you say the AssemblyFileVersion is different, can you give the exact old and new version? If it's incremented, InstallShield should automatically do what you are looking for provided you've made the DLL the keyfile of it's own component. – Christopher Painter Jan 04 '13 at 13:18
  • Dear Mr Painter, I think you did not read my question properly. The file version of existing dll is greater than the file version of dll which should be installed. Why would I post a question otherwise?? – SujanKh Jan 07 '13 at 05:41
  • What is the exact AssemblyFileVersion for of the original file A and the patched file A? – Christopher Painter Jan 07 '13 at 13:00
  • Assembly Version for both DLLs: 8.303.0.21. File Version for original DLL :8.303.0.21 .File version for patched DLL = 8.3.0.41415 – SujanKh Jan 08 '13 at 04:17
  • Then there's your problem. 8.303 is greater then 8.3. Windows Installer will not overwrite. I said in my answer that it needed to be *INCREMENTED*. – Christopher Painter Jan 08 '13 at 13:00
  • You can't modify the DLL yourself because it has a strong name and you wouldn't be able to resign it. If you can't get the vendor to fix their DLL, your only other option is called "version lying" aka "always overwrite" in InstallShield. This tricks MSI into thinking the file version is greater then it actually is. It works, but it's not the optimal solution. – Christopher Painter Jan 08 '13 at 13:14