Skip to content
⌘ NSIS Forum Archive

GetWindowsVersion and Error flags

4 posts

Isolated#

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...