Skip to content

Commit

Permalink
Windows 8.1 and 10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
rotthh committed Aug 17, 2015
1 parent e18dcc6 commit 27e0aa2
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
<PropertyGroup>
<StartupObject>xClient.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
Expand Down Expand Up @@ -210,6 +213,7 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down
18 changes: 18 additions & 0 deletions Client/Core/Helper/PlatformHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ static PlatformHelper()
VistaOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 6;
SevenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 1));
EightOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200));
EightPointOneOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 3));
TenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(10, 0));
RunningOnMono = Type.GetType("Mono.Runtime") != null;

Name = "Unknown OS";
Expand Down Expand Up @@ -90,5 +92,21 @@ static PlatformHelper()
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightOrHigher { get; private set; }

/// <summary>
/// Returns a value indicating whether the Operating System is Windows 8.1 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8.1 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightPointOneOrHigher { get; private set; }

/// <summary>
/// Returns a value indicating whether the Operating System is Windows 10 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 10 or higher; otherwise, <c>false</c>.
/// </value>
public static bool TenOrHigher { get; private set; }
}
}
27 changes: 26 additions & 1 deletion Server/Core/Helper/PlatformHelper.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System;
using System.Management;
using System.Text.RegularExpressions;

namespace xServer.Core.Helper
namespace xClient.Core.Helper
{
public static class PlatformHelper
{
Expand All @@ -14,9 +16,16 @@ static PlatformHelper()
VistaOrHigher = Win32NT && Environment.OSVersion.Version.Major >= 6;
SevenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 1));
EightOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 2, 9200));
EightPointOneOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(6, 3));
TenOrHigher = Win32NT && (Environment.OSVersion.Version >= new Version(10, 0));
RunningOnMono = Type.GetType("Mono.Runtime") != null;
}

/// <summary>
/// Gets the name of the operating system running on this computer (including the edition).
/// </summary>
public static string Name { get; private set; }

/// <summary>
/// Determines if the current application is 32 or 64-bit.
/// </summary>
Expand Down Expand Up @@ -69,5 +78,21 @@ static PlatformHelper()
/// <c>true</c> if the Operating System is Windows 8 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightOrHigher { get; private set; }

/// <summary>
/// Returns a value indicating whether the Operating System is Windows 8.1 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 8.1 or higher; otherwise, <c>false</c>.
/// </value>
public static bool EightPointOneOrHigher { get; private set; }

/// <summary>
/// Returns a value indicating whether the Operating System is Windows 10 or higher.
/// </summary>
/// <value>
/// <c>true</c> if the Operating System is Windows 10 or higher; otherwise, <c>false</c>.
/// </value>
public static bool TenOrHigher { get; private set; }
}
}
6 changes: 4 additions & 2 deletions Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,12 @@
<PropertyGroup>
<StartupObject>xServer.Program</StartupObject>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
<ApplicationIcon>xRAT-64x64.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>xRAT-64x64.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
Expand Down Expand Up @@ -436,6 +437,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<Compile Include="Core\Extensions\SocketExtensions.cs" />
<None Include="app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
Expand Down

0 comments on commit 27e0aa2

Please sign in to comment.