diff --git a/DerpingDrivers/DerpingDrivers.csproj b/DerpingDrivers/DerpingDrivers.csproj
index a5403c2..69311c4 100644
--- a/DerpingDrivers/DerpingDrivers.csproj
+++ b/DerpingDrivers/DerpingDrivers.csproj
@@ -113,6 +113,7 @@
+
diff --git a/DerpingDrivers/MainWindow.xaml b/DerpingDrivers/MainWindow.xaml
index af68f01..88cc331 100644
--- a/DerpingDrivers/MainWindow.xaml
+++ b/DerpingDrivers/MainWindow.xaml
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:local="clr-namespace:DerpingDrivers"
+ xmlns:util="clr-namespace:DerpingDrivers.Util"
xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d"
@@ -15,6 +15,9 @@
BorderThickness="0"
GlowBrush="{DynamicResource AccentColorBrush}"
DataContext="{Binding RelativeSource={RelativeSource Self}}">
+
+
+
@@ -100,7 +103,8 @@
Header="Allow Prerelease Signatures"
OnLabel="TESTSINGING is on"
OffLabel="TESTSINGING is off"
- IsChecked="{Binding Path=AllowPrereleaseSignatures}" />
+ IsChecked="{Binding Path=AllowPrereleaseSignatures}"
+ IsEnabled="{Binding Path=IsSecureBootEnabled, Converter={StaticResource InverseBooleanConverter}}"/>
-
+
/// Gets test-mode status.
///
- public string TestSigningStatus => CodeIntegrityHelper.IsTestSignEnabled ? "Enabled" : "Disabled";
+ public string TestSigningStatus => UefiHelper.IsRunningInUefiMode && UefiHelper.IsSecureBootEnabled
+ ?
+ "Not available"
+ : CodeIntegrityHelper.IsTestSignEnabled
+ ? "Enabled"
+ : "Disabled";
+
+ ///
+ /// True if SecureBoot enabled, false otherwise.
+ ///
+ public bool IsSecureBootEnabled => UefiHelper.IsRunningInUefiMode && UefiHelper.IsSecureBootEnabled;
///
/// Gets or sets whether prerelease signatures (a.k.a. TESTSIGNING) are accepted by the kernel.
diff --git a/DerpingDrivers/Util/InverseBooleanConverter.cs b/DerpingDrivers/Util/InverseBooleanConverter.cs
new file mode 100644
index 0000000..c203669
--- /dev/null
+++ b/DerpingDrivers/Util/InverseBooleanConverter.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+
+namespace DerpingDrivers.Util
+{
+ [ValueConversion(typeof(bool), typeof(bool))]
+ public class InverseBooleanConverter : IValueConverter
+ {
+ #region IValueConverter Members
+
+ public object Convert(object value, Type targetType, object parameter,
+ CultureInfo culture)
+ {
+ if (targetType != typeof(bool))
+ throw new InvalidOperationException("The target must be a boolean");
+
+ return !(bool) value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter,
+ CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file