1
0

Added summary skeletons

This commit is contained in:
Benjamin Höglinger-Stelzer 2018-10-26 21:26:34 +02:00
parent 41d0b98b20
commit 2b1071408d
15 changed files with 155 additions and 45 deletions

View File

@ -155,6 +155,14 @@
<Generator>SettingsSingleFileGenerator</Generator> <Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput> <LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None> </None>
<None Include="Resources\win10_x64_uefi_clean.md" />
<None Include="Resources\win10_x64_uefi_secure_clean.md" />
<None Include="Resources\win10_x64_uefi_secure_upgraded.md" />
<None Include="Resources\win10_x64_uefi_upgraded.md" />
<None Include="Resources\win10_x86_uefi_clean.md" />
<None Include="Resources\win10_x86_uefi_secure_clean.md" />
<None Include="Resources\win10_x86_uefi_secure_upgraded.md" />
<None Include="Resources\win10_x86_uefi_upgraded.md" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />

View File

@ -6,6 +6,7 @@
xmlns:local="clr-namespace:DerpingDrivers" xmlns:local="clr-namespace:DerpingDrivers"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro" xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:markdig="clr-namespace:Markdig.Wpf;assembly=Markdig.Wpf"
mc:Ignorable="d" mc:Ignorable="d"
Title="Derping Drivers - Windows driver compatibility detection tool" Title="Derping Drivers - Windows driver compatibility detection tool"
Height="440" Width="700" Height="440" Width="700"
@ -15,6 +16,10 @@
BorderThickness="0" BorderThickness="0"
GlowBrush="{DynamicResource AccentColorBrush}" GlowBrush="{DynamicResource AccentColorBrush}"
DataContext="{Binding RelativeSource={RelativeSource Self}}"> DataContext="{Binding RelativeSource={RelativeSource Self}}">
<FrameworkElement.CommandBindings>
<CommandBinding Command="{x:Static markdig:Commands.Hyperlink}" Executed="OpenHyperlink" />
</FrameworkElement.CommandBindings>
<TabControl Margin="15"> <TabControl Margin="15">
<!-- System Details --> <!-- System Details -->
<TabItem Header="System Details"> <TabItem Header="System Details">
@ -74,7 +79,7 @@
<!-- Compatibility Summary --> <!-- Compatibility Summary -->
<TabItem Header="Compatibility Summary"> <TabItem Header="Compatibility Summary">
<FlowDocumentScrollViewer VerticalScrollBarVisibility="Auto" Document="{Binding SummaryDocument}" /> <markdig:MarkdownViewer x:Name="SummaryViewer"/>
</TabItem> </TabItem>
<!-- About --> <!-- About -->

View File

@ -22,6 +22,15 @@ namespace DerpingDrivers
public MainWindow() public MainWindow()
{ {
InitializeComponent(); InitializeComponent();
Loaded += OnLoaded;
}
private void OnLoaded(object sender, RoutedEventArgs e)
{
SummaryViewer.Pipeline = new MarkdownPipelineBuilder().UseSupportedExtensions().Build();
SummaryViewer.Markdown = MatchingSummaryContent;
} }
/// <summary> /// <summary>
@ -68,32 +77,22 @@ namespace DerpingDrivers
/// </summary> /// </summary>
public string TestSigningStatus => CodeIntegrityHelper.IsTestSignEnabled ? "Enabled" : "Disabled"; public string TestSigningStatus => CodeIntegrityHelper.IsTestSignEnabled ? "Enabled" : "Disabled";
public FlowDocument SummaryDocument private string MatchingSummaryContent
{ {
get get
{ {
var markdown = Encoding.UTF8.GetString(Properties.Resources.testsigning); if (!CodeIntegrityHelper.IsTestSignEnabled)
// Convert Markdown to XAML
var xaml = Markdown.ToXaml(markdown, BuildPipeline());
// Render XAML for FlowDocument Control
using (var stream = new MemoryStream(Encoding.UTF8.GetBytes(xaml)))
{ {
var reader = new XamlXmlReader(stream, new MyXamlSchemaContext()); return Encoding.UTF8.GetString(Properties.Resources.testsigning);
if (XamlReader.Load(reader) is FlowDocument document) return document;
} }
return null; if (OsVersionInfo.IsWindows10)
} {
}
private static MarkdownPipeline BuildPipeline() }
{
return new MarkdownPipelineBuilder() return "*None available*";
.UseSupportedExtensions() }
.Build();
} }
private void Web_OnClick(object sender, RoutedEventArgs e) private void Web_OnClick(object sender, RoutedEventArgs e)
@ -110,20 +109,10 @@ namespace DerpingDrivers
{ {
Process.Start("https://forums.vigem.org"); Process.Start("https://forums.vigem.org");
} }
}
internal class MyXamlSchemaContext : XamlSchemaContext private void OpenHyperlink(object sender, System.Windows.Input.ExecutedRoutedEventArgs e)
{
public override bool TryGetCompatibleXamlNamespace(string xamlNamespace, out string compatibleNamespace)
{ {
if (xamlNamespace.Equals("clr-namespace:Markdig.Wpf")) Process.Start(e.Parameter.ToString());
{
compatibleNamespace =
$"clr-namespace:Markdig.Wpf;assembly={Assembly.GetAssembly(typeof(Styles)).FullName}";
return true;
}
return base.TryGetCompatibleXamlNamespace(xamlNamespace, out compatibleNamespace);
} }
} }
} }

View File

@ -69,5 +69,85 @@ namespace DerpingDrivers.Properties {
return ((byte[])(obj)); return ((byte[])(obj));
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x64_uefi_clean {
get {
object obj = ResourceManager.GetObject("win10_x64_uefi_clean", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x64_uefi_secure_clean {
get {
object obj = ResourceManager.GetObject("win10_x64_uefi_secure_clean", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x64_uefi_secure_upgraded {
get {
object obj = ResourceManager.GetObject("win10_x64_uefi_secure_upgraded", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x64_uefi_upgraded {
get {
object obj = ResourceManager.GetObject("win10_x64_uefi_upgraded", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x86_uefi_clean {
get {
object obj = ResourceManager.GetObject("win10_x86_uefi_clean", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x86_uefi_secure_clean {
get {
object obj = ResourceManager.GetObject("win10_x86_uefi_secure_clean", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x86_uefi_secure_upgraded {
get {
object obj = ResourceManager.GetObject("win10_x86_uefi_secure_upgraded", resourceCulture);
return ((byte[])(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// </summary>
internal static byte[] win10_x86_uefi_upgraded {
get {
object obj = ResourceManager.GetObject("win10_x86_uefi_upgraded", resourceCulture);
return ((byte[])(obj));
}
}
} }
} }

View File

@ -121,4 +121,28 @@
<data name="testsigning" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="testsigning" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\testsigning.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>..\Resources\testsigning.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data> </data>
<data name="win10_x64_uefi_clean" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x64_uefi_clean.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x64_uefi_secure_clean" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x64_uefi_secure_clean.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x64_uefi_secure_upgraded" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x64_uefi_secure_upgraded.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x64_uefi_upgraded" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x64_uefi_upgraded.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x86_uefi_clean" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x86_uefi_clean.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x86_uefi_secure_clean" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x86_uefi_secure_clean.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x86_uefi_secure_upgraded" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x86_uefi_secure_upgraded.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="win10_x86_uefi_upgraded" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\win10_x86_uefi_upgraded.md;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root> </root>

View File

@ -1,5 +1,7 @@
# Hello # ☠️ TESTSIGNING enabled ☠️
## Second To disable test-signing, execute the following command in an [elevated prompt](https://www.thewindowsclub.com/how-to-run-command-prompt-as-an-administrator):
🎃 Waddup! ```cmd
bcdedit.exe -set TESTSIGNING OFF
```

View File

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Windows;
using Markdig.Helpers; using Markdig.Helpers;
using Microsoft.Win32; using Microsoft.Win32;
@ -55,13 +54,16 @@ namespace DerpingDrivers.Util
#region Windows 10/Server 2016+ Detection #region Windows 10/Server 2016+ Detection
private static bool IsWindows10() public static bool IsWindows10
{ {
var releaseId = (string) Registry.GetValue( get
@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion", {
"ReleaseId", null); var releaseId = (string) Registry.GetValue(
@"HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion",
"ReleaseId", null);
return !string.IsNullOrEmpty(releaseId) && Windows10ReleaseIds.Any(id => id.Contains(releaseId)); return !string.IsNullOrEmpty(releaseId) && Windows10ReleaseIds.Any(id => id.Contains(releaseId));
}
} }
#endregion #endregion
@ -613,7 +615,7 @@ namespace DerpingDrivers.Util
minorVersion = Convert.ToInt32(splitResult[1]); minorVersion = Convert.ToInt32(splitResult[1]);
} }
if (IsWindows10()) if (IsWindows10)
{ {
majorVersion = 10; majorVersion = 10;
minorVersion = 0; minorVersion = 0;
@ -1038,7 +1040,7 @@ namespace DerpingDrivers.Util
{ {
get get
{ {
if (IsWindows10()) return 10; if (IsWindows10) return 10;
var exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", var exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion",
"CurrentVersion", ""); "CurrentVersion", "");
if (!string.IsNullOrEmpty(exactVersion)) if (!string.IsNullOrEmpty(exactVersion))
@ -1062,7 +1064,7 @@ namespace DerpingDrivers.Util
{ {
get get
{ {
if (IsWindows10()) return 0; if (IsWindows10) return 0;
var exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", var exactVersion = RegistryRead(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion",
"CurrentVersion", ""); "CurrentVersion", "");
if (!string.IsNullOrEmpty(exactVersion)) if (!string.IsNullOrEmpty(exactVersion))
@ -1086,7 +1088,7 @@ namespace DerpingDrivers.Util
{ {
get get
{ {
if (IsWindows10()) return 0; if (IsWindows10) return 0;
return Environment.OSVersion.Version.Revision; return Environment.OSVersion.Version.Revision;
} }
} }