Updating an ActiveX DLL
Question:
I have several of your programs installed on many machines. The problem is that some of these are older file DLL’s that need updating. What is the easiest way to update a DLL? If I run the .msi install, I just end up with two version of the DLL when I go into add/remove programs of the DLL.
Any suggestions would be appreciated. I am doing this for many machines remotely and would like to be able to script it.
Answer:
Having a fundamental understanding of ActiveX registration will answer all of your questions (in fact, the answers will be obvious). Spending 15 minutes reading this page ( http://www.chilkatsoft.com/p/p_177.asp ) will save you many hours in the long run and you’ll seem like a genius to others… ;-)
I’ll boil the contents of that page down even further: In a nutshell, the purpose of ActiveX registration is to associate a name with a DLL file. When your source code contains some form of CreateObject(“Chilkat.MailMan”), the underlying software (VB runtime, ASP runtime, whatever…) needs to lookup “Chilkat.MailMan” in the Windows registry to find the DLL file it should load. Simply knowing this answers all sorts of questions:
- Does my DLL need to be located in system32? No. Because the registry entry may point to a DLL located anywhere in the filesystem. (Any software that installs DLLs into system32 is a clear indication that the application developer doesn’t have an inkling of an understanding of ActiveX registration.)
- Can I change the name of my DLL after registering it? No, because the registry entry is pointing to the DLL file. If you change the name, you better change the registry entry (i.e. re-register the DLL with regsvr32)
- How do I update the DLL? Simple: Copy over the old DLL. The registry entry is still pointing to it so there’s no worry there… It’s possible that a process (such as IIS) has a lock on the DLL such that you cannot copy over the existing DLL. In that case, restart IIS (or whatever process is holding the lock) and then copy.