private static string GetWindowsKit10() { string environmentVariable = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); string text = Path.Combine(environmentVariable, "Windows Kits\\10\\"); try { text = RegistryUtil.GetRegistryStringValue("SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v10.0", "InstallationFolder", text, RegistryView._32); } catch { } string result; if (!Directory.Exists(text)) { result = string.Empty; } else { result = text; } return(result); }