forked from toehead2001/aeroshot
-
Notifications
You must be signed in to change notification settings - Fork 7
/
VersionHelpers.cs
41 lines (32 loc) · 1.81 KB
/
VersionHelpers.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using Microsoft.Win32;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
namespace AeroShot
{
public static class VersionHelpers
{
public static bool AeroGlassForWin8IsRunning()
{
return Process.GetProcessesByName("aerohost").Length > 0;
}
public static bool HasAeroAfterglow()
{
return (Environment.OSVersion.Version.Build >= 6730 && Environment.OSVersion.Version.Build < 8432) || AeroGlassForWin8IsRunning();
}
public static bool HasAeroTransparency()
{
return (Environment.OSVersion.Version.Major == 6
&& Environment.OSVersion.Version.Major > 5001 // pre-reset is hell, 500x does't have Aero
&& Environment.OSVersion.Version.Build < 8432) || AeroGlassForWin8IsRunning();
}
public static bool IsWindowsVista() => (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major == 0); // 6.0.5048-6.0.6469
public static bool IsWindows7() => (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major == 1); // 6.1.6519-6.2.7850
public static bool IsWindows8() => (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major == 2); // 6.2.7875-6.3.9299
public static bool IsWindows81() => (Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major == 3); // 6.3.9364-6.3.9785
public static bool IsWindows10() => ((Environment.OSVersion.Version.Major == 6 && Environment.OSVersion.Version.Major == 4) // 6.4.9821-10.0.21390.2025
|| (Environment.OSVersion.Version.Major == 10 && Environment.OSVersion.Version.Build < 21900));
public static bool IsWindows11() => Environment.OSVersion.Version.Build >= 21900;
}
}