Skip to content
⌘ NSIS Forum Archive

How to check registry key type

5 posts

engg.mukesh#

How to check registry key type

I want to check that whether the registry key "Notification Packages" located at "HKLM\SYSTEM\ControlSet001\Control\Lsa" is of the type "String-Value (REG_SZ)" OR "MULTI-STRING VALUE (REG_MULTI_SZ)", using NSIS.

Please let me know how to do that.
engg.mukesh#
The thing is before reading the registry entry I need to know that whether the registry is of type type "String-Value (REG_SZ)" OR "MULTI-STRING VALUE (REG_MULTI_SZ)".
In some system it is of type REG_SZ and others it is of type REG_MULTI_SZ.

Therefore, first of all I need to check the type and than accordingly read the previous value.
Anders#
NSIS will not let you check the type, use the registry plugin or call the registry api functions directly with the system plugin
Animaether#
Part of the example code checks whether the type is REG_MULTI_SZ (it's the first check, actually) - leverage that 🙂