Which versions of Windows will this match for? And can't this `if` be just one line?