Custom Inventory RegistryValueEquals
Trying to do a custom inventory on a reg value using RegistryValueEquals
This is the syntax, which I am not sure is correct since it isn't working
RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Boeing\CAx\DFoP\B19SP5PRALL,HFX,16)
Attached is screenshot of the registry
This is the syntax, which I am not sure is correct since it isn't working
RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Boeing\CAx\DFoP\B19SP5PRALL,HFX,16)
Attached is screenshot of the registry
0 Comments
[ + ] Show comments
Answers (16)
Please log in to answer
Posted by:
airwolf
14 years ago
Posted by:
KnottyMan
14 years ago
Trying to do a similar thing.
I have a company tree (UMC) that I'm starting to build up for my tricky software.
Trying to evaluate RegistryValueEquals(SOFTWARE\UMC\CadDuct, Version, 2.38.218) but it always returns false.
However, an export from the registry results in
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct]
"Version"="2.38.218"
I have similar results that return true (RegistryValueEquals(HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe, BrowserFix,True))
That's a custom registry key that I put in
So what's the difference other than the key location and that it's text. The agent is supposed to be able to do version comparisons according to the admin guide.
I have a company tree (UMC) that I'm starting to build up for my tricky software.
Trying to evaluate RegistryValueEquals(SOFTWARE\UMC\CadDuct, Version, 2.38.218) but it always returns false.
However, an export from the registry results in
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct]
"Version"="2.38.218"
I have similar results that return true (RegistryValueEquals(HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe, BrowserFix,True))
That's a custom registry key that I put in
So what's the difference other than the key location and that it's text. The agent is supposed to be able to do version comparisons according to the admin guide.
Posted by:
airwolf
14 years ago
Posted by:
GillySpy
14 years ago
Tip:
to determine what the registry value is you can create a custom data field to have it spit out that value in inventory. The
RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct,Version,TEXT)
I haven't seen this discrepancy with registry keys but I have with file versions -- where the file version shows on the PC differently in different places. In one place it might show as 2.38.218 and in another as 2,38,218
So you can use that technique to find out what kbox sees it as and then create your custom inventory field.
to determine what the registry value is you can create a custom data field to have it spit out that value in inventory. The
RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct,Version,TEXT)
I haven't seen this discrepancy with registry keys but I have with file versions -- where the file version shows on the PC differently in different places. In one place it might show as 2.38.218 and in another as 2,38,218
So you can use that technique to find out what kbox sees it as and then create your custom inventory field.
Posted by:
KnottyMan
14 years ago
Per page 83 in the admin guide, the example provided is "RegistryValueEquals(SOFTWARE\Microsoft\Internet Explorer\Version Vector,IE,6.000)" and I seem to recall from jumpstart that this was an allowed shortcut that the agent would recognize. I thought that I also tried the absolute path per syntax (p83) "RegistryValueEquals(string absPathToKey, string valueName, string valueToTest)".
Also from page 83, "Contain a key that exists under LocalMachine." so seeing this, why need to specify HKLM... However, that is blown out of the water since I do have a separate test in HKClassesRoot that does work...
Did my admin guide not update last time I did an upgrade and the bot behavior change? I will double check with specifying the abspath and try again.
Also from page 83, "Contain a key that exists under LocalMachine." so seeing this, why need to specify HKLM... However, that is blown out of the water since I do have a separate test in HKClassesRoot that does work...
Did my admin guide not update last time I did an upgrade and the bot behavior change? I will double check with specifying the abspath and try again.
Posted by:
airwolf
14 years ago
Posted by:
KnottyMan
14 years ago
Tried Gerald's suggestion, no data returned, but in the debug log I got a true.
True = RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct, Version, TEXT)
Tried absolute path, still returns false.
False = RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct, Version, 2.38.218)
Stumped
Guess I'll try to see if it will give me a true for KeyExists to see if it can find the key at all...
True = RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct, Version, TEXT)
Tried absolute path, still returns false.
False = RegistryValueEquals(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct, Version, 2.38.218)
Stumped
Guess I'll try to see if it will give me a true for KeyExists to see if it can find the key at all...
Posted by:
KnottyMan
14 years ago
Posted by:
airwolf
14 years ago
Tried Gerald's suggestion, no data returned, but in the debug log I got a true.
True = RegistryValueReturn(HKEY_LOCAL_MACHINE\SOFTWARE\UMC\CadDuct, Version, TEXT)
There is definitely an issue if the registry key can be read but no data is returned. I'd suggest submitting a support ticket so KACE can take a look.
Posted by:
KnottyMan
14 years ago
Posted by:
airwolf
14 years ago
Posted by:
KnottyMan
14 years ago
Well there's a critical piece of information I left out. How dumb is this whole Program Files, Program Files (x86) business and now a separate Software tree...? Good thing this CadDuct app is only for V64 clients, otherwise I'd have dupes all over the place!
WHY MS, why oh why are you so retarded? One cohesive tree please!
Thanks Andy, that did it.
WHY MS, why oh why are you so retarded? One cohesive tree please!
Thanks Andy, that did it.
Posted by:
dtuttle
14 years ago
Well there's a critical piece of information I left out. How dumb is this whole Program Files, Program Files (x86) business and now a separate Software tree...? Good thing this CadDuct app is only for V64 clients, otherwise I'd have dupes all over the place!
WHY MS, why oh why are you so retarded? One cohesive tree please!
Windows registry/file redirection for 32bit/64bit apps is a pain to deal with, but without it we wouldn't be able to run 32bit apps on 64bit OS's. things like hklm\software\wow6432node is the 32bit registry, which is the system.dat file that is in c:\windows\syswow64 folder. This folder also contains all the dlls and windows programs needed to run 32bit apps. if you run the cmd.exe in that folder you are in the 32bit shell, everything happens with redirection, if you run the cmd.exe in system32 you are using 64bit shell and things are done without redirection.
I know this goes way past why you originally asked, but I have been implementing 64bit OS's here for a while due to the memory capacity it has, so I have had to due alot of research on this redirection. Kbox doesn't have great support for 64bit redirection yet, things like Custom inventory rules in the 32bit PF dir dont work so well, and writing to the 64bit reg is an extra step. I hope they will come around to it soon though
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.