I have a utility which updates applications by simply copying/replacing the executables. Now, I have some DLL files which need to be updated as well. However, sometimes Windows will not let me replace it because something is using it, and sometimes there's so many things using the DLL that I cannot guarantee it will be unlocked for me to replace it.
Currently, my only work-around is to re-name the existing DLL first, and then I can copy the new one in its place. But then the old DLL gets left behind with an altered file name.
How can I replace a DLL programatically in this situation?
LoadLibrary
on that DLL. Test it out for yourself. – CloudyUnLoadOpenSSLLibrary
procedure from theIdSSLOpenSSL.pas
unit. – Ivan