Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to install shared DLLs on Windows

I have a driver which can be installed on Windows (XP/Vista/7). It's accessed via a native C++ DLL that 3rd-party applications link to, and which is also a Winsock Provider (WSP). It used to be installed under System32, but having seen advice not to, I changed it to install under ProgramFiles instead.

Now, the problem is that people are having to either copy it back into System32 or copy it into the application directory whenever they want to use it in their own applications, because Windows won't search the install directory under ProgramFiles when the application tries to load the DLL.

I've been unable to find any Microsoft documentation discussing this issue, so if System32 shouldn't be used then where should shared DLLs be installed?

like image 437
BCran Avatar asked Apr 20 '10 18:04

BCran


People also ask

What is shared DLLs in Windows 10?

The legacy shared DLLs reference counting is a mechanism by which the Windows Operating System ensures that files which are shared are reference counted, so that if a product attempts to uninstall a file which is used by another product, then the file is not deleted.

Where is the dynamic link library located?

The name of this directory is System32. The 16-bit system directory.

What does missing shared DLL mean?

When Ccleaner finds a registry entry that calls for a DLL that does not exist, it reports this as a "Missing Shared DLL" and gives you the opportunity to remove the invalid entry.


1 Answers

The Windows side-by-side cache. Backgrounder info is here, technical reference is here.

I haven't seen anybody actually do this yet, other than Microsoft. Quite notable is that MSFT gave up on winsxs deployment for the C/C++ CRT and MFC runtime DLLs for VS2010, it was causing too many problems. They're back in c:\windows\system32. The managed equivalent of this (the GAC) is going strong though. Better tool support, probably.

I'm fairly sure that by a large margin everybody chooses app-local deployment.

like image 164
Hans Passant Avatar answered Nov 15 '22 09:11

Hans Passant