With "install as shared DLLs" I mean that runtime libraries (eg. Visual C++, VB) get an entry in the registry:
There a DLL's reference count gets increased when an application also uses that DLL. If that application will be uninstalled, the DLLs reference count gets decreased. If a DLL's reference count reaches 0, the DLL can be deleted.
That seems to be the "clean way", but I'm not sure.
A quick Google finds this
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)