I have a function that is checking for the minimum versions of MSSQLExpress installed on a server. When i test the installer with a version lower than the required versions the code works and errors out with my expected message. When i upgrade MSSQLExpress to the required version or above it will still act like it's reading the original version number and continue to error out. I have checked the registry key that it's looking for and it's updating with the correct value but my installer is still coming back with the older version number. This behavior persists through reboots as well.

Here is the section of code that has the logic. Everything else is just Messages for the user.

But, then I install SP3 which brings the version number in the registry up to 10.50.6000. The same exact command that worked before looking at the same registry key that has updated if you look at it in regedit, still shows the old version number.

I don't really understand why it's still showing the old version number when you can look in regedit and see that the version has updated?