diff --git a/DerpingDrivers/DerpingDrivers.csproj b/DerpingDrivers/DerpingDrivers.csproj
index 90d319e..78cd9e7 100644
--- a/DerpingDrivers/DerpingDrivers.csproj
+++ b/DerpingDrivers/DerpingDrivers.csproj
@@ -38,6 +38,7 @@
TRACE
prompt
4
+ false
app.manifest
@@ -120,6 +121,7 @@
+
diff --git a/DerpingDrivers/MainWindow.xaml b/DerpingDrivers/MainWindow.xaml
index 1741c3d..8d55c86 100644
--- a/DerpingDrivers/MainWindow.xaml
+++ b/DerpingDrivers/MainWindow.xaml
@@ -22,7 +22,7 @@
-
+
@@ -45,7 +45,7 @@
-
+
@@ -78,8 +78,37 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -106,7 +135,7 @@
Style="{DynamicResource MetroCircleButtonStyle}"
Content="{iconPacks:FontAwesome Kind=WordpressBrands, Width=32, Height=32}"
ToolTip="Visit home page"
- Click="Web_OnClick"/>
+ Click="Web_OnClick" />
-
+ Click="Discord_OnClick" />
+
+ Click="Forums_OnClick" />
diff --git a/DerpingDrivers/MainWindow.xaml.cs b/DerpingDrivers/MainWindow.xaml.cs
index 9056855..ecdc59f 100644
--- a/DerpingDrivers/MainWindow.xaml.cs
+++ b/DerpingDrivers/MainWindow.xaml.cs
@@ -65,6 +65,20 @@ namespace DerpingDrivers
///
public string TestSigningStatus => CodeIntegrityHelper.IsTestSignEnabled ? "Enabled" : "Disabled";
+ public bool AllowPrereleaseSignatures
+ {
+ get => BcdHelper.AllowPrereleaseSignatures;
+ set => BcdHelper.AllowPrereleaseSignatures = value;
+ }
+
+ public bool WhqlDeveloperTestMode
+ {
+ get => CodeIntegrityPolicyHelper.WhqlDeveloperTestMode;
+ set => CodeIntegrityPolicyHelper.WhqlDeveloperTestMode = value;
+ }
+
+ public bool IsWindows10 => OsVersionInfo.IsWindows10;
+
private string MatchingSummaryContent
{
get
diff --git a/DerpingDrivers/Util/BcdHelper.cs b/DerpingDrivers/Util/BcdHelper.cs
index 05deef0..32e63c0 100644
--- a/DerpingDrivers/Util/BcdHelper.cs
+++ b/DerpingDrivers/Util/BcdHelper.cs
@@ -1,5 +1,7 @@
-using System.Diagnostics;
+using System;
+using System.Diagnostics;
using DerpingDrivers.Exceptions;
+using ExceptionReporting;
using Microsoft.Win32;
namespace DerpingDrivers.Util
@@ -26,45 +28,62 @@ namespace DerpingDrivers.Util
set
{
- if (value)
+ try
{
- // NOTE: haven't found an API for this (yet), so system() we go!
- var cmd = new Process
+ if (value)
{
- StartInfo =
+ // NOTE: haven't found an API for this (yet), so system() we go!
+ var cmd = new Process
{
- FileName = "Bcdedit.exe",
- Arguments = "-set TESTSIGNING ON",
- WindowStyle = ProcessWindowStyle.Hidden,
- CreateNoWindow = true
- }
- };
+ StartInfo =
+ {
+ FileName = @"C:\WINDOWS\system32\bcdedit.exe",
+ Arguments = "-set TESTSIGNING ON",
+ WindowStyle = ProcessWindowStyle.Hidden,
+ CreateNoWindow = true,
+ UseShellExecute = false
+ }
+ };
- cmd.Start();
- cmd.WaitForExit();
+ cmd.Start();
+ cmd.WaitForExit();
- if (cmd.ExitCode != 0)
- throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't enable TESTSIGNING");
+ if (cmd.ExitCode != 0)
+ throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't enable TESTSIGNING");
+ }
+ else
+ {
+ // NOTE: haven't found an API for this (yet), so system() we go!
+ var cmd = new Process
+ {
+ StartInfo =
+ {
+ FileName = @"C:\WINDOWS\system32\bcdedit.exe",
+ Arguments = "-set TESTSIGNING OFF",
+ WindowStyle = ProcessWindowStyle.Hidden,
+ CreateNoWindow = true,
+ UseShellExecute = false
+ }
+ };
+
+ cmd.Start();
+ cmd.WaitForExit();
+
+ if (cmd.ExitCode != 0)
+ throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't disable TESTSIGNING");
+ }
}
- else
+ catch (Exception ex)
{
- // NOTE: haven't found an API for this (yet), so system() we go!
- var cmd = new Process
+ var er = new ExceptionReporter
{
- StartInfo =
+ Config =
{
- FileName = "Bcdedit.exe",
- Arguments = "-set TESTSIGNING OFF",
- WindowStyle = ProcessWindowStyle.Hidden,
- CreateNoWindow = true
+ AppName = "DerpingDrivers",
+ SendMethod = ReportSendMethod.None
}
};
-
- cmd.Start();
- cmd.WaitForExit();
-
- if (cmd.ExitCode != 0)
- throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't disable TESTSIGNING");
+ er.Show(ex);
}
}
}
diff --git a/DerpingDrivers/Util/CodeIntegrityPolicyHelper.cs b/DerpingDrivers/Util/CodeIntegrityPolicyHelper.cs
new file mode 100644
index 0000000..e79b31d
--- /dev/null
+++ b/DerpingDrivers/Util/CodeIntegrityPolicyHelper.cs
@@ -0,0 +1,24 @@
+using System;
+using Microsoft.Win32;
+
+namespace DerpingDrivers.Util
+{
+ public static class CodeIntegrityPolicyHelper
+ {
+ public static bool WhqlDeveloperTestMode
+ {
+ get
+ {
+ var value = (int?) Registry.GetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy",
+ "WhqlDeveloperTestMode", null);
+
+ if (value == null) return false;
+
+ return value > 0;
+ }
+
+ set => Registry.SetValue(@"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\CI\Policy",
+ "WhqlDeveloperTestMode", Convert.ToInt32(value), RegistryValueKind.DWord);
+ }
+ }
+}
\ No newline at end of file