waldoor
12th April 2010 07:59 UTC
Re reading the Registry
I read a registry key, and when it is not valid, I run an additional external installer (JAVA) with ExecWait. After the installer has executed successfully, I want to re read the same registry key. First calling ClearErrors before checking the registry key.
Now the script always return an error. It seems that rereading the registry failed now.
How could that be?
Animaether
12th April 2010 15:29 UTC
are you assuming that the registry key is created by that external installer?
are you correct in that assumption? :)
waldoor
12th April 2010 16:06 UTC
yes, I knwo the key is changed. While a message box showed me the error (did not clock ok), I opened the registry, and was able to see the mentioned key.
Animaether
12th April 2010 16:29 UTC
Try making sure you're reading the right key. If you're on a 64bit OS, make sure your installer is reading from the right section as well ( SetRegView ).
If you -are- reading the right key - and you're actually getting a value out of it - make sure the value is of the type corresponding to your ReadReg* command. E.g. per the documentation.. if you use ReadRegStr to read a REG_DWORD, the value will be read okay but the error flag will be set.
This can easily be tested while you know that the value is there, so that you can eliminate any (rare and unlikely timing problems with the external installer.