Archive: How to check registry key type


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.


http://nsis.sourceforge.net/Docs/AppendixD.html#D.5 - D.5 How to Read REG_MULTI_SZ Values


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.


NSIS will not let you check the type, use the registry plugin or call the registry api functions directly with the system plugin


Part of the example code checks whether the type is REG_MULTI_SZ (it's the first check, actually) - leverage that :)