Archive: Re reading the Registry


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?


are you assuming that the registry key is created by that external installer?
are you correct in that assumption? :)


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.


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.