cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tomerdr
Level 6

How to check if registry entry exist?

Hi,

I am using system search to look for registry entry

How do I check using install script if the search was successful?

Must I use MsiGetProperty to get the value of the property and then use
some string comparison function?!?!

What happen if the search failed, will I get empty property? so maybe i just need to check the return buffer size?

Thanks in advance.
Labels (1)
0 Kudos
(3) Replies
Gvarma
Level 7

tomerdr wrote:
Hi,

I am using system search to look for registry entry

How do I check using install script if the search was successful?

Must I use MsiGetProperty to get the value of the property and then use
some string comparison function?!?!

What happen if the search failed, will I get empty property? so maybe i just need to check the return buffer size?

Thanks in advance.


You could use functions like RegDBGetKeyValueEx() which take some paratmeters (look at IS help) and returns 0 on sucess and 1 on failures. It also returns the value of a key specified in a specified var (specified as parameters), once you have executed RegDBGetKeyValueEx () sucessfully , you could use simple comparison to see if there is any valued returned in specified variable.

HTH
0 Kudos
RobertDickau
Flexera Alumni

If you do want to use the property and not read the registry directly, there's MsiEvaluateCondition.
0 Kudos
tomerdr
Level 6

i Want to minimze use of installscript functions so i will be prepared for WIX...

MsiEvaluateCondition looking good....

Thanks
0 Kudos