Merge pull request #333 from MaxXor/pr/332

Proper support for Windows 8.1 and 10
This commit is contained in:
MaxXor 2015-08-18 07:21:33 +02:00
commit 476063e0d3
6 changed files with 103 additions and 3 deletions

View File

@ -38,6 +38,9 @@
<PropertyGroup>
<StartupObject>xClient.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.VisualBasic" />
<Reference Include="System" />
@ -211,6 +214,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>

View File

@ -16,6 +16,8 @@ namespace xClient.Core.Helper
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";
@ -90,5 +92,21 @@ namespace xClient.Core.Helper
/// <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; }
}
}

29
Client/app.manifest Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. -->
<!-- Windows XP ignores this section. -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</asmv1:assembly>

View File

@ -14,6 +14,8 @@ namespace xServer.Core.Helper
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;
}
@ -69,5 +71,21 @@ namespace xServer.Core.Helper
/// <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; }
}
}

View File

@ -40,12 +40,13 @@
<PropertyGroup>
<StartupObject>xServer.Program</StartupObject>
</PropertyGroup>
<PropertyGroup>
<NoWin32Manifest>true</NoWin32Manifest>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<ApplicationIcon>xRAT-64x64.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Cecil, Version=0.9.5.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -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>

29
Server/app.manifest Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of all Windows versions that this application is designed to work with. -->
<!-- Windows XP ignores this section. -->
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
</application>
</compatibility>
</asmv1:assembly>