Old 23rd February 2013, 16:51   #1
RossW
Member
 
Join Date: Jun 2006
Posts: 54
How to tell if a Dll is Registered?

I searched the forum but everything I found related to knowing about an installable Dll, and of course the "!insertmacro InstallLib REGDLL" handles that for you. In my case, the Dll in question is not part of my installer but I want to alert the user running my installer if the MS Windows Image Acquisition Library (wiaaut.dll) isn't registered on their system (seems like it's there ootb for Windows 7 but not for XP. For Windows Server 2008, the dll can be found in a subfolder but it's not registered).

Is there an easy way to tell if a Dll is registered on a box? I know the GUID for the Dll's TypeLib entry in the registry (HKEY_CLASSES_ROOT\TypeLib\{94A0E92D-43C0-494E-AC29-FD45948A5221}) but is checking for that sufficient? I'd also like to know the install path which really depends on the OS (for XP, it's c:\windows\system32\wiaaut.dll) which might be under different subkeys depending on the OS (again, on XP it's there under 1.0 > 0 > win32).
RossW is offline   Reply With Quote
Old 24th February 2013, 01:39   #2
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
Well, if we talk about "registering" a DLL, we actually talk about COM DLL's. Registering a COM "in process" server (COM DLL) does nothing but calling the DllRegisterServer entry point of the DLL. It's up to the developer of the COM DLL to create and export that function. It may do pretty much anything! It usually creates the registry entries needed to make the COM class provided by the DLL available to other applications, but it may do arbitrary other things.

I guess the best way to check whether a "COM DLL" is "registered" would be checking whether the COM class provided by that DLL - and after all that's what you want to use, right? - is available or not. Just try to create an instance of that class via CoCreateInstance(), using the right CLSID. If that function fails with REGDB_E_CLASSNOTREG it means the class is not registered. And thus the COM DLL that is supposed to provide that class obviously has not been registered yet...

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 27th February 2013, 15:26   #3
RossW
Member
 
Join Date: Jun 2006
Posts: 54
That sounds ideal, LoRd_MuldeR. I have the TypeLib GUID for the dll - how do I find the CLSID?
RossW is offline   Reply With Quote
Old 27th February 2013, 19:37   #4
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
OleView?

http://www.microsoft.com/en-us/downl....aspx?id=17657

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump