User Code for Registry Key Validation

Ask general questions here.
gvijay11
Posts: 7
Joined: Thu Apr 11, 2019 4:26 pm

User Code for Registry Key Validation

Post by gvijay11 » Fri Jan 31, 2020 4:12 pm

I want to validate multiple registry key values. Please help me to get this done with User Code.

Sample : Validate the Key Value Name "Path" under the Registry Path HKEY_LOCAL_MACHINE\SOFTWARE\7-Zip is having the Value Data as "C:\Program Files\7-Zip\"

Similarly i need to validate multiple registry keys within a User Code.

User avatar
Stub
Posts: 373
Joined: Fri Jul 15, 2016 1:35 pm

Re: User Code for Registry Key Validation

Post by Stub » Mon Feb 03, 2020 8:49 am

I use module parameters to specify the key and value names, plus the expected data that should be in the registry.

I have separate code modules for HKLM and HKCU to reduce the number of module parameters, plus they also cope with 32bit/64bit differences in HKLM, depending on which flavour of our AUT is being tested.

They study the AUT to determine the exact registry path to the given key where appropriate (we have different flavours of our AUT so the paths are similar but different because the product name changes in certain ways).

I then augmented this set of validation code modules with getters, setters, and also some deleters, that are equally driven by the module parameters.

You can either data-drive a registry validator code module to validator multiple registry keys, or maybe it's appropriate in your scenario to do a known batch in a single hit. I've not had to do the latter here yet.

gvijay11
Posts: 7
Joined: Thu Apr 11, 2019 4:26 pm

Re: User Code for Registry Key Validation

Post by gvijay11 » Mon Feb 03, 2020 10:54 am

Thanks for your suggestion. Can you please share your sample code.