Fixed the issue that someone could have a windows 10 version which is older than what we can support. (#207)

Also upgrade Inno Setup and SVG
This commit is contained in:
Robin Krom 2020-05-10 23:04:31 +02:00 committed by GitHub
parent 2a5ae1557e
commit 5db1f5564b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 6 deletions

View file

@ -56,7 +56,7 @@
</PropertyGroup>
<ItemGroup Condition="!$(MSBuildProjectName.Contains('Tests')) And $(MSBuildProjectName.StartsWith('Greenshot'))">
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.74">
<PackageReference Include="Nerdbank.GitVersioning" Version="3.1.91">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>

View file

@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Tools.InnoSetup" version="6.0.3" GeneratePathProperty="true" />
<PackageReference Include="Tools.InnoSetup" version="6.0.4" GeneratePathProperty="true" />
</ItemGroup>
<ItemGroup>

View file

@ -41,7 +41,7 @@ namespace GreenshotPlugin.Core
public static bool IsWindows7OrLater { get; } = WinVersion.Major == 6 && WinVersion.Minor >= 1 || WinVersion.Major > 6;
public static bool IsWindows7OrLower { get; } = WinVersionTotal <= 6.1;
/// <summary>
/// Test if the current OS is Windows 8.0
/// </summary>
@ -102,6 +102,11 @@ namespace GreenshotPlugin.Core
/// <returns>true if we are running on Windows XP or later</returns>
public static bool IsWindowsXpOrLater { get; } = WinVersion.Major >= 5 || WinVersion.Major == 5 && WinVersion.Minor >= 1;
/// <summary>
/// Returns the windows build number
/// </summary>
public static int BuildVersion => WinVersion.Build;
/// <summary>
/// Test if the current Windows version is 10 and the build number or later
/// See the build numbers <a href="https://en.wikipedia.org/wiki/Windows_10_version_history">here</a>

View file

@ -15,7 +15,7 @@
<ItemGroup>
<PackageReference Include="Dapplo.HttpExtensions.JsonNet" Version="0.10.9" />
<PackageReference Include="log4net" version="2.0.8" />
<PackageReference Include="Svg" Version="3.0.102" />
<PackageReference Include="Svg" Version="3.1.1" />
<Reference Include="Accessibility" />
<Reference Include="CustomMarshalers" />
</ItemGroup>

View file

@ -35,7 +35,9 @@ namespace GreenshotWin10Plugin
[Plugin("Win10", false)]
public sealed class Win10Plugin : IGreenshotPlugin
{
public void Dispose()
private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(typeof(Win10Plugin));
public void Dispose()
{
Dispose(true);
}
@ -58,8 +60,10 @@ namespace GreenshotWin10Plugin
/// <returns>true if plugin is initialized, false if not (doesn't show)</returns>
public bool Initialize()
{
if (!WindowsVersion.IsWindows10OrLater)
// Here we check if the build version of Windows is actually what we support
if (!WindowsVersion.IsWindows10BuildOrLater(17763))
{
Log.WarnFormat("No support for Windows build {0}", WindowsVersion.BuildVersion);
return false;
}