diff --git a/App.xaml.cs b/App.xaml.cs
index a98807c..332cbf1 100644
--- a/App.xaml.cs
+++ b/App.xaml.cs
@@ -25,6 +25,20 @@ namespace QoSManager
{
base.OnStartup(e);
+ // Проверка версии Windows
+ var versionService = new WindowsVersionService();
+ var windowsInfo = versionService.GetWindowsInfo();
+
+ if (!windowsInfo.IsQoSSupported)
+ {
+ var warningWindow = new UnsupportedVersionWindow(windowsInfo);
+ warningWindow.ShowDialog();
+
+ // Always exit on unsupported version
+ Shutdown();
+ return;
+ }
+
// Проверка административных прав
if (!IsAdministrator())
{
diff --git a/QoSManager.csproj b/QoSManager.csproj
index cce3e07..7cb9dc5 100644
--- a/QoSManager.csproj
+++ b/QoSManager.csproj
@@ -11,7 +11,7 @@
app.manifest
Resources\icon.ico
-
+
none
false
true
diff --git a/Services/WindowsVersionService.cs b/Services/WindowsVersionService.cs
new file mode 100644
index 0000000..981e272
--- /dev/null
+++ b/Services/WindowsVersionService.cs
@@ -0,0 +1,85 @@
+using Microsoft.Win32;
+using System;
+
+namespace QoSManager.Services
+{
+ public class WindowsVersionService
+ {
+ public enum WindowsEdition
+ {
+ Home,
+ Pro,
+ Enterprise,
+ Education,
+ Unknown
+ }
+
+ public class WindowsInfo
+ {
+ public WindowsEdition Edition { get; set; }
+ public string ProductName { get; set; }
+ public bool IsQoSSupported { get; set; }
+ public string VersionString { get; set; }
+ }
+
+ public WindowsInfo GetWindowsInfo()
+ {
+ var info = new WindowsInfo();
+
+ try
+ {
+ // Получаем информацию о версии Windows из реестра
+ using (var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows NT\CurrentVersion"))
+ {
+ if (key != null)
+ {
+ var productName = key.GetValue("ProductName")?.ToString() ?? "Unknown";
+ info.ProductName = productName;
+ info.Edition = ParseEdition(productName);
+ info.IsQoSSupported = IsQoSSupported(info.Edition);
+ info.VersionString = $"{productName} ({info.Edition})";
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ info.ProductName = "Error reading version";
+ info.Edition = WindowsEdition.Unknown;
+ info.IsQoSSupported = false;
+ info.VersionString = $"Error: {ex.Message}";
+ }
+
+ return info;
+ }
+
+ private WindowsEdition ParseEdition(string productName)
+ {
+ if (string.IsNullOrEmpty(productName))
+ return WindowsEdition.Unknown;
+
+ productName = productName.ToLowerInvariant();
+
+ if (productName.Contains("home"))
+ return WindowsEdition.Home;
+ if (productName.Contains("pro"))
+ return WindowsEdition.Pro;
+ if (productName.Contains("enterprise"))
+ return WindowsEdition.Enterprise;
+ if (productName.Contains("education"))
+ return WindowsEdition.Education;
+
+ return WindowsEdition.Unknown;
+ }
+
+ private bool IsQoSSupported(WindowsEdition edition)
+ {
+ return edition switch
+ {
+ WindowsEdition.Pro => true,
+ WindowsEdition.Enterprise => true,
+ WindowsEdition.Education => true,
+ _ => false
+ };
+ }
+ }
+}
diff --git a/Views/UnsupportedVersionWindow.xaml b/Views/UnsupportedVersionWindow.xaml
new file mode 100644
index 0000000..2b7c722
--- /dev/null
+++ b/Views/UnsupportedVersionWindow.xaml
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Views/UnsupportedVersionWindow.xaml.cs b/Views/UnsupportedVersionWindow.xaml.cs
new file mode 100644
index 0000000..ab29682
--- /dev/null
+++ b/Views/UnsupportedVersionWindow.xaml.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Windows;
+using QoSManager.Services;
+
+namespace QoSManager.Views
+{
+ public partial class UnsupportedVersionWindow : Window
+ {
+ private readonly WindowsVersionService.WindowsInfo _windowsInfo;
+
+ public UnsupportedVersionWindow(WindowsVersionService.WindowsInfo windowsInfo)
+ {
+ InitializeComponent();
+ _windowsInfo = windowsInfo;
+ DataContext = this;
+ VersionText.Text = _windowsInfo.VersionString;
+ }
+
+ private void ExitButton_Click(object sender, RoutedEventArgs e)
+ {
+ // User decided to exit
+ DialogResult = false;
+ Close();
+ }
+ }
+}