/build/static/layout/Breadcrumb_cap_w.png

Compare a Registry value

Hello,

I'm working on building a script to push out .NET 4.5.2 to a group of our machines, but only if the computer has a prior 4.5 release. I'm using the information here to get the actual version I'm checking for:

https://msdn.microsoft.com/en-us/library/hh925568(v=vs.110).aspx

I'm creating a verification step to verify a registry value is less than...

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

Name: Release

Value: 379873


However - it doesn't seem to matter what the value is, it always fails the check. Even if I manually edit that value on a target machine to a value < the value I'm checking for, it will fail. What am I missing? If I take that verification step out altogether, it will run of course.

I realize that if that version of the .NET Framework is already installed, a silent execution of it will just abort w/o actually trying to install it - but that requires extracting the package to each machine before that step is done, so basically I'm just trying to speed the process up.

Thanks,

James



3 Comments   [ + ] Show comments
  • How do you verify the value of the key ? The content of this key is in hex maybe here is the problem. - gwir 8 years ago
  • I'm using the verification step to verify a registry value; if I specify an action to verify the value equals a comparison value, then it will pass the test. I'm guessing because the value is being interpreted as a string that somehow the comparison isn't being done as a numerical check? - JLankford 8 years ago
  • Normally I would have included code with my initial posting, but since I'm doing this entirely in the KACE web interface, I'm not really writing code; is there a way I can export the actual script from KACE?

    Under the Tasks section, Task 1, under the Verify action, I 'Add' a step to 'Verify a registry value is less than...', and then provide the values - basically filling in the blanks - with the info from my original post:

    Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full

    Name: Release

    Value: 379893

    On machines where the Value is less than what I'm checking for (379893), it continually fails - even if I modify the registry setting on the target computer to be significantly lower than the value I'm comparing against.

    However, if I change the step to 'Verify a registry value is exactly...', and then run it again a machine it will evaluate correctly - meaning if the target machine's value is 379893, the step will pass; otherwise it will fail, as it should.

    Does this help explain? - JLankford 8 years ago
    • Hello,

      I test with our K1000 6.4 SP2, and it works.

      Can't help more... - gwir 8 years ago

Answers (1)

Posted by: anonymous_9363 8 years ago
Red Belt
1
Without seeing your code, how could anyone know why it's failing?

Post it here but remember to apply the 'Code' style to it: it makes the post easier to read.

Comments:
  • Refer to my comment above; it wouldn't let me reply directly to your comment. Thanks! - JLankford 8 years ago
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ