static string GetWindowsVersion() { string osVersion = WindowsVersion.GetWindowsVersionFromSystemManagement(); if (!string.IsNullOrEmpty(osVersion)) { return(osVersion); } return(WindowsVersion.GetWindowsVersionFromEnvironment()); }