diff --git a/DerpingDrivers/DerpingDrivers.csproj b/DerpingDrivers/DerpingDrivers.csproj
index fd1ad3d..90d319e 100644
--- a/DerpingDrivers/DerpingDrivers.csproj
+++ b/DerpingDrivers/DerpingDrivers.csproj
@@ -79,9 +79,6 @@
..\packages\PInvoke.Windows.Core.0.5.155\lib\net35\PInvoke.Windows.Core.dll
-
- ..\packages\RunProcessAsTask.1.2.3\lib\net45\RunProcessAsTask.dll
-
..\packages\Simple-MAPI.NET.1.1.0\lib\net20\SimpleMapi.dll
diff --git a/DerpingDrivers/MainWindow.xaml.cs b/DerpingDrivers/MainWindow.xaml.cs
index a7b9d13..1ca018d 100644
--- a/DerpingDrivers/MainWindow.xaml.cs
+++ b/DerpingDrivers/MainWindow.xaml.cs
@@ -69,6 +69,8 @@ namespace DerpingDrivers
{
get
{
+ BcdHelper.DisableTestSigning();
+
var t = BcdHelper.IsTestSignEnabled;
#region TESTSIGNING mode
diff --git a/DerpingDrivers/Util/BcdHelper.cs b/DerpingDrivers/Util/BcdHelper.cs
index 01418e1..7ac878a 100644
--- a/DerpingDrivers/Util/BcdHelper.cs
+++ b/DerpingDrivers/Util/BcdHelper.cs
@@ -1,6 +1,6 @@
-using DerpingDrivers.Exceptions;
+using System.Diagnostics;
+using DerpingDrivers.Exceptions;
using Microsoft.Win32;
-using RunProcessAsTask;
namespace DerpingDrivers.Util
{
@@ -18,30 +18,50 @@ namespace DerpingDrivers.Util
$@"HKEY_LOCAL_MACHINE\BCD00000000\Objects\{bootmgrDefaultGuid}\Elements\16000049",
"Element", default(byte[]));
- return allowPrereleaseSignatures != null && bool.Parse(allowPrereleaseSignatures[0].ToString());
+ return allowPrereleaseSignatures != null && int.Parse(allowPrereleaseSignatures[0].ToString()) > 0;
}
}
public static void EnableTestSigning()
{
// NOTE: haven't found an API for this (yet), so system() we go!
- var ret = ProcessEx.RunAsync("Bcdedit.exe", "-set TESTSIGNING ON").Result;
-
- if (ret.ExitCode != 0)
+ var cmd = new Process
{
+ StartInfo =
+ {
+ FileName = "Bcdedit.exe",
+ Arguments = "-set TESTSIGNING ON",
+ WindowStyle = ProcessWindowStyle.Hidden,
+ CreateNoWindow = true
+ }
+ };
+
+ cmd.Start();
+ cmd.WaitForExit();
+
+ if (cmd.ExitCode != 0)
throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't enable TESTSIGNING");
- }
}
public static void DisableTestSigning()
{
// NOTE: haven't found an API for this (yet), so system() we go!
- var ret = ProcessEx.RunAsync("Bcdedit.exe", "-set TESTSIGNING OFF").Result;
-
- if (ret.ExitCode != 0)
+ var cmd = new Process
{
+ StartInfo =
+ {
+ FileName = "Bcdedit.exe",
+ Arguments = "-set TESTSIGNING OFF",
+ WindowStyle = ProcessWindowStyle.Hidden,
+ CreateNoWindow = true
+ }
+ };
+
+ cmd.Start();
+ cmd.WaitForExit();
+
+ if (cmd.ExitCode != 0)
throw new BcdAlterAllowPrereleaseSignaturesFailedException("Couldn't disable TESTSIGNING");
- }
}
}
}
\ No newline at end of file
diff --git a/DerpingDrivers/packages.config b/DerpingDrivers/packages.config
index cb07c84..5901955 100644
--- a/DerpingDrivers/packages.config
+++ b/DerpingDrivers/packages.config
@@ -12,6 +12,5 @@
-
\ No newline at end of file