Files
DP44/DataPRO/Modules/InstallerCustomActions/.svn/pristine/b7/b758e2b4310f07e1a01028cf492ed815b51c1873.svn-base
2026-04-17 14:55:32 -04:00

40 lines
1.3 KiB
Plaintext

using System;
using System.Diagnostics;
using System.Windows;
namespace WarnWindows11
{
public class OSWarning
{
public static void Main(string[] args)
{
try
{
var windows11 = false;
using (var process = new Process())
{
process.StartInfo.FileName = "systeminfo.exe";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.Start();
// Synchronously read the standard output of the spawned process.
var reader = process.StandardOutput;
string output = reader.ReadToEnd();
var lines = output.Split(new[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
foreach (var line in lines)
{
if (line.ToUpper().Contains("MICROSOFT WINDOWS 11")) { windows11 = true; }
}
process.WaitForExit();
}
if (windows11) { _ = MessageBox.Show(Properties.Resources.WARNING_WINDOWS11); }
}
catch (Exception) { }
}
}
}