Check OS compat on startup, prompt for enabling dev mode

This commit is contained in:
N00MKRAD
2021-04-04 17:47:47 +02:00
parent 4789e3a254
commit b9b282a71b
7 changed files with 147 additions and 8 deletions

View File

@@ -3,7 +3,10 @@ using System.Text;
using System.Security.Principal;
using System;
using System.Diagnostics;
using System.IO;
using System.Management;
using System.Threading.Tasks;
using System.Windows.Forms;
using Flowframes.IO;
using DiskDetector;
using DiskDetector.Models;
@@ -132,5 +135,25 @@ namespace Flowframes.OS
return 1000;
}
}
public static string GetOs()
{
string info = "";
using (ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem"))
{
ManagementObjectCollection information = searcher.Get();
if (information != null)
{
foreach (ManagementObject obj in information)
info = $"{obj["Caption"]} | {obj["OSArchitecture"]}";
}
info = info.Replace("NT 5.1.2600", "XP").Replace("NT 5.2.3790", "Server 2003");
}
return info;
}
}
}