title: How to detect if a Windows version is legal or not?
body: <p>I'm not interested in getting version information. All I want to do is to make sure my application will only run on a legal version of Windows and not on a pirated version. Windows uses some trick to determine this but still allows pirated versions to continue to run, although with some limits.</p>
  
  <p>So, is there a way to check if the application is installed on a legal, genuine Windows version? (Vista and better, at least.)</p>
  
  <hr />
  
  <p>Let me clear something up: Microsoft isn't preventing users to use a non-validated or illegal version of their operating system. Thus I don't have any reasons to block my application on such a version either. But I do want my application to be aware of the illegal version and warn the user that his Windows version isn't validated. Maybe he forgot, maybe he doesn't want to validate. There could be plenty of reasons for this and I don't want to block them, just making them aware of a problem with their Windows version. </p>
  
  <p>Also, when someone uses a non-valid version of Windows then I might want to do a more strict validation check of my own software, if it's a commercial product. In my free products, I just want an annoying popup, which will just appear once per day.</p>
  
  <p>The main problem with non-validated Windows versions is that they might contain additional spyware and other malware and there's a chance that they don't get all required updates. These Windows versions have a weaker protection than validated Windows versions. Since several of my applications use sensitive data, I don't want any malware leaking away this sensitive data.</p>
  
  <p>Plus, I consider pirated software harmful for any free alternatives. Linux and FreeBSD would have been much more popular if it wasn't for all those pirated Windows versions that are roaming around. People who use pirated software are unlikely to have bought the product in the first place but I would prefer them to use a free alternative instead. Pirated software does a little harm to Microsoft, but it does a lot more harm to the Free community since it keeps people connected to those commercial products...</p>