cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
dmetzler
Level 6

enumerating registry keys?

As a custom step in my install, I want to determine if certain hardware is present on the target computer. To do this, I need to enumerate the registry keys located at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318} and determine the value of the "DriverDesc" sub key, searching for specific text.

My installer is a Basic MSI Project. What is the best way to enumerate and search the registry keys?

Thanks,

Don Metzler
Labels (1)
0 Kudos

(3) Replies
dmetzler
Level 6

dmetzler wrote:
As a custom step in my install, I want to determine if certain hardware is present on the target computer. To do this, I need to enumerate the registry keys located at:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318} and determine the value of the "DriverDesc" sub key, searching for specific text.


I have successfully done this in a custom DLL.

Now I would like to exit the install if my DLL function returns a FALSE value. How can a custom action be modified to allow the installation to exit based on a return value from calling a custom DLL?

Thanks,

Don
0 Kudos
KathyMorey
Level 10

If you have set up your dll as a Windows Installer dll, you can set a property in it to indicate failure, then create a type 19 custom action to run afterwards if that property is set.
0 Kudos
RobertDickau
Flexera Alumni

You could also have the DLL return ERROR_INSTALL_FAILURE to trigger the exit; that's not as flexible as Kathy's solution, though, for displaying a custom message.
0 Kudos