Archive: GetWindowsVersion and Error flags


GetWindowsVersion and Error flags
Hi!

I'm using the GetWindowsVersion to determine the OS that is installed.

On WinXP everything was fine, but then I tested it under VMware (Win98) and my script didn't work.

The reason: if in GetWindowsVersion the first ReadRegStr ("ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion") fails, cause you are not on a NT system, the ReadRegStr sets the errorflag. The function GetWindowsVersion returns the correct result but I called it inside a file-reading loop and after GetWindowsVersion was called the 'iferrors done' canceled the file reading.

My Solution was to add two ClearErrors after the two ReadRegStr in GetWindowsVersion.

But perhaps an official workaround would be better....

Thank you in advance...


I'll use IfErrors. That will clear the error flag.


OK. Thank you...

I will use it when it's ready...


Already uploaded :D Use NSIS Update to get the latest version (or check the Archive).