PDA

View Full Version : Get Registry Subkey bug?



JerryS@cat
04-14-2015, 11:57 AM
If this problem has been previously reported, I apologize for the duplication, but I've searched through the forum and haven't found any
similar references to this problem. I've noticed recently that there seems to be a minor problem with the Get Registry Subkey command. I honestly don't know if this error popped up after the recent v8.5 update or if it has been a problem before that update.

To illustrate the problem, I'm going to use the HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList registry key, which looks like
this:

- ProfileList
S-1-5-18
S-1-5-19
S-1-5-20
S-1-5-21-443186426-36040666280-3422536360-500
S-1-5-21-602162358-1060284298-1801674531-1406

Specifically, invoking the Get Registry Subkey command with a Subkey ID of "0" brings back correctly brings back a value of "5" since there
are 5 subkeys beneath the \ProfileList key. However, when you increment that Subkey ID by a value of 1, the next iteration of Get Registry Subkey does not bring back a value of "S-1-5-18" as it should -- it brings back a value of "S-1-5-19". For some reason, there doesn't seem to be a way to bring back the value of the first subkey beneath a key. The code I used is below and is actually almost identical to the example code in the Forum and also in the Reference manual for enumerating a registry key. I've already had one other SetupBuilder developer verify this, but I thought it should be submitted to the Forum for additional verification.


Set Variable %NUM_SUBKEYS% to FUNCTION:Get Registry SubKey("0") from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"

Display Message Box "The number of subkeys = %NUM_SUBKEYS%" -- "Number of Subkeys"

Set Variable %LOOPCTR% to "0"

Loop (%NUM_SUBKEYS% Times)
Set Variable %LOOPCTR% to (Increment by 1)
Set Variable %WORK_SUBKEY% to FUNCTION:Get Registry SubKey("%LOOPCTR%") from "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList"
Display Message Box "This is loop iteration #%LOOPCTR%\nThe retrieved s..." -- "Loop iteration"
End

linder
04-15-2015, 03:05 AM
Hi Jerry,

This is definitely a bug in the SetupBuilder runtime :( It's caused by the following:

SetupBuilder 2015 Version 8.5 Build 4714 (March 06, 2015)
NEW : Installer: Add an enhanced "Get Registry SubKey..." script function to improve performance dramatically (and fixes an annoying memory leak).

Thank you for bringing this to our attention. It's fixed now (the new maintenance build will be made available later today).

Thanks again!

Friedrich

JerryS@cat
04-15-2015, 07:20 AM
Just glad it was apparently easy for you to fix. Thought for a day or two that I was going crazy and it was time to hang it up, move to a beach, and just sell t-shirts.

linder
04-15-2015, 07:41 AM
<BG> ;)

The new SetupBuilder Developer Edition 8.5 Build 4754 is available now. Does this fix it for you?

Thanks,
Friedrich

JerryS@cat
04-15-2015, 12:40 PM
Works just fine now. Thanks for the quick response and action.

linder
04-16-2015, 02:41 AM
Thank YOU !!!

Friedrich