Skip to content

Commit

Permalink
-added BIOS or UEFI definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedeks committed Jan 14, 2025
1 parent feb553a commit a698582
Show file tree
Hide file tree
Showing 13 changed files with 28 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .Source/GTweak/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<ResourceDictionary Source="Styles/Inputs/Slider.xaml" />
<ResourceDictionary Source="Styles/Inputs/TextBox.xaml" />
<ResourceDictionary Source="Styles/Inputs/ComboBox.xaml" />
<ResourceDictionary Source="Styles/Media/Page.xaml" />
<ResourceDictionary Source="Styles/Media/Images.xaml" />
<ResourceDictionary Source="Styles/Media/Rectangle.xaml" />
<ResourceDictionary Source="Styles/Page.xaml" />
<ResourceDictionary Source="Styles/Images.xaml" />
<ResourceDictionary Source="Styles/Rectangle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
Expand Down
6 changes: 4 additions & 2 deletions .Source/GTweak/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ internal static string Language
"en" => new Uri("Languages/en/Localize.xaml", UriKind.Relative),
"ko" => new Uri("Languages/ko/Localize.xaml", UriKind.Relative),
"ru" => new Uri("Languages/ru/Localize.xaml", UriKind.Relative),
_ => GettingSystemLanguage switch {
_ => GettingSystemLanguage switch
{
string lang when lang.Contains("ko") => new Uri("Languages/ko/Localize.xaml", UriKind.Relative),
string lang when lang.Contains("ru") => new Uri("Languages/ru/Localize.xaml", UriKind.Relative),
_ => new Uri("Languages/en/Localize.xaml", UriKind.Relative) }
_ => new Uri("Languages/en/Localize.xaml", UriKind.Relative)
}
}
};

Expand Down
1 change: 1 addition & 0 deletions .Source/GTweak/Core/ViewModel/DataSystemVM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public DataSystemVM()
{
new DataSystemModel { Name = "Windows", Data = SystemDiagnostics.HardwareData["Windows"] },
new DataSystemModel { Name = "Processes", Data = new MonitoringSystem().GetNumberRunningProcesses },
new DataSystemModel { Name = "Firmware", Data = SystemDiagnostics.Firmware },
new DataSystemModel { Name = "Bios", Data = !string.IsNullOrEmpty(SystemDiagnostics.HardwareData["BIOS"]) ? SystemDiagnostics.HardwareData["BIOS"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
new DataSystemModel { Name = "Motherboard", Data = !string.IsNullOrEmpty(SystemDiagnostics.HardwareData["MotherBr"]) ? SystemDiagnostics.HardwareData["MotherBr"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
new DataSystemModel { Name = "Processor", Data = !string.IsNullOrEmpty(SystemDiagnostics.HardwareData["CPU"]) ? SystemDiagnostics.HardwareData["CPU"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
Expand Down
6 changes: 3 additions & 3 deletions .Source/GTweak/GTweak.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,11 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\Media\Images.xaml">
<Page Include="Styles\Images.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\Media\Page.xaml">
<Page Include="Styles\Page.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down Expand Up @@ -397,7 +397,7 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Styles\Media\Rectangle.xaml">
<Page Include="Styles\Rectangle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
3 changes: 2 additions & 1 deletion .Source/GTweak/Languages/en/Localize.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@
<!--#region Information System Page -->
<v:String x:Key="title_win_systemInformation">Operating system:</v:String>
<v:String x:Key="runprocces_systemInformation">Number of running processes:</v:String>
<v:String x:Key="title_bios_systemInformation">BIOS:</v:String>
<v:String x:Key="title_firmware_b_systemInformation">BIOS:</v:String>
<v:String x:Key="title_firmware_u_systemInformation">UEFI:</v:String>
<v:String x:Key="title_motherbr_systemInformation">Motherboard:</v:String>
<v:String x:Key="title_cpu_systemInformation">Processor:</v:String>
<v:String x:Key="title_gpu_systemInformation">Graphics:</v:String>
Expand Down
3 changes: 2 additions & 1 deletion .Source/GTweak/Languages/ko/Localize.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@
<!--#region Information System Page -->
<v:String x:Key="title_win_systemInformation">운영 체제:</v:String>
<v:String x:Key="runprocces_systemInformation">실행 중인 프로세스 번호:</v:String>
<v:String x:Key="title_bios_systemInformation">BIOS:</v:String>
<v:String x:Key="title_firmware_b_systemInformation">BIOS:</v:String>
<v:String x:Key="title_firmware_u_systemInformation">UEFI:</v:String>
<v:String x:Key="title_motherbr_systemInformation">머더보드:</v:String>
<v:String x:Key="title_cpu_systemInformation">프로세스:</v:String>
<v:String x:Key="title_gpu_systemInformation">그래픽:</v:String>
Expand Down
3 changes: 2 additions & 1 deletion .Source/GTweak/Languages/ru/Localize.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,8 @@
<!--#region Information System Page -->
<v:String x:Key="title_win_systemInformation">Операционная система:</v:String>
<v:String x:Key="runprocces_systemInformation">Кол-во запущенных процессов:</v:String>
<v:String x:Key="title_bios_systemInformation">БИОС:</v:String>
<v:String x:Key="title_firmware_b_systemInformation">BIOS:</v:String>
<v:String x:Key="title_firmware_u_systemInformation">UEFI:</v:String>
<v:String x:Key="title_motherbr_systemInformation">Материнская плата:</v:String>
<v:String x:Key="title_cpu_systemInformation">Процессор:</v:String>
<v:String x:Key="title_gpu_systemInformation">Видеокарта:</v:String>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 8 additions & 2 deletions .Source/GTweak/Utilities/Configuration/SystemDiagnostics.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Microsoft.Win32;
using GTweak.Utilities.Helpers;
using Microsoft.Win32;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
Expand All @@ -13,6 +14,7 @@
using System.Windows.Media;
using System.Windows.Media.Imaging;


namespace GTweak.Utilities.Configuration
{
internal sealed class SystemDiagnostics
Expand All @@ -37,6 +39,7 @@ internal enum ConnectionStatus
internal static ConnectionStatus CurrentConnection = ConnectionStatus.Lose;

internal static string WindowsClientVersion { get; set; } = string.Empty;
internal static string Firmware { get; set; } = Application.Current.Resources["title_firmware_b_systemInformation"].ToString();

internal static readonly Dictionary<string, string> HardwareData = new Dictionary<string, string>()
{
Expand Down Expand Up @@ -107,8 +110,11 @@ private void GetOperatingSystemInfo()
HardwareData["Windows"] = $"\n{HardwareData["Windows"].TrimEnd('\n')}";
}

private void GetBiosInfo()
private async void GetBiosInfo()
{
string output = await CommandExecutor.GetCommandOutput("bcdedit");
Firmware = Application.Current.Resources[output.Contains(@"\EFI") ? "title_firmware_u_systemInformation" : "title_firmware_b_systemInformation"].ToString();

foreach (var managementObj in new ManagementObjectSearcher(@"root\cimv2", "select Name, Caption, Description, SMBIOSBIOSVersion, SerialNumber from Win32_BIOS", new EnumerationOptions { ReturnImmediately = true }).Get())
{
string data = new[] { "Name", "Caption", "Description", "SMBIOSBIOSVersion" }.Select(prop => (string)managementObj[prop]).FirstOrDefault(info => !string.IsNullOrEmpty(info)) ?? string.Empty;
Expand Down
3 changes: 2 additions & 1 deletion .Source/GTweak/Utilities/Helpers/RegistryHelp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ internal static void CreateFolder(RegistryKey registrykey, string subkey)
{
Task.Run(delegate
{
try {
try
{
registrykey.CreateSubKey(subkey);
}
catch (Exception ex) { Debug.WriteLine(ex.Message); }
Expand Down
2 changes: 1 addition & 1 deletion .Source/GTweak/View/DataSystemView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@

<Grid Grid.Row="0">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_bios_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
<TextBlock Text="{Binding [Firmware].Data}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
<TextBlock Text="{Binding [Bios].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
Expand Down

0 comments on commit a698582

Please sign in to comment.