Skip to content

Commit

Permalink
Merge branch 'dev' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Timthreetwelve committed Jul 26, 2021
2 parents 1116f99 + dc94276 commit 9eb1f0b
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 32 deletions.
23 changes: 11 additions & 12 deletions HWiNFOVSBViewer/About.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@
<Image
Grid.Row="1"
Grid.Column="1"
Width="69"
Height="69"
Margin="12,0,0,5"
Width="75"
Height="75"
Margin="5,0,0,5"
HorizontalAlignment="Left"
Source="TextTemplate.ico"
Stretch="UniformToFill"
Source="H-in-blue-cloud.ico"
ToolTip="Built with ❤ in Texas" />
<!--#endregion-->

Expand All @@ -61,9 +60,9 @@
<TextBlock
Margin="10,5,0,5"
HorizontalAlignment="Left"
FontSize="13"
Text="View HWiNFO VSB Registry Values."
TextWrapping="Wrap" />
FontSize="13">
View, sort and export HWiNFO<LineBreak />
VSB Registry Values.</TextBlock>

</StackPanel>
<!--#endregion-->
Expand Down Expand Up @@ -111,13 +110,13 @@
Grid.ColumnSpan="2"
Margin="10,0"
Orientation="Horizontal">
<TextBlock Width="90" Text="Email:" />
<TextBlock Width="90" Text="GitHub:" />
<TextBlock>
<Hyperlink
NavigateUri="mailto: KennedyTim@outlook.com?subject=HWiFNO VSB Viewer Feedback"
NavigateUri="https://github.com/Timthreetwelve/HWiNFO-VSB-Viewer"
RequestNavigate="OnNavigate"
ToolTip="Send a friendly email to Tim">
[email protected]
ToolTip="https://github.com/Timthreetwelve/HWiNFO-VSB-Viewer">
HWiNFO-VSB-Viewer
</Hyperlink>
</TextBlock>
</StackPanel>
Expand Down
Binary file added HWiNFOVSBViewer/H-in-blue-cloud.ico
Binary file not shown.
Binary file added HWiNFOVSBViewer/H-in-blue-cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions HWiNFOVSBViewer/HWiNFO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class HWiNFO : IComparable<HWiNFO>

public static List<HWiNFO> HWList = new List<HWiNFO>();

public static string RegistryKey { get; set; }

public int CompareTo(HWiNFO other)
{
// A null value means that this object is greater.
Expand Down
11 changes: 10 additions & 1 deletion HWiNFOVSBViewer/HWiNFOVSBViewer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -33,9 +34,10 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>TextTemplate.ico</ApplicationIcon>
<ApplicationIcon>H-in-blue-cloud.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand Down Expand Up @@ -116,5 +118,12 @@
<ItemGroup>
<Resource Include="TextTemplate.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\H-in-blue-cloud.ico" />
<Resource Include="Images\H-in-blue-cloud.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="H-in-blue-cloud.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Binary file added HWiNFOVSBViewer/Images/H-in-blue-cloud.ico
Binary file not shown.
Binary file added HWiNFOVSBViewer/Images/H-in-blue-cloud.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 44 additions & 17 deletions HWiNFOVSBViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,45 @@ private void ReadSettings()
}
#endregion Settings

#region Check registry for HWiNFO64 and HWiNFO32
private void CheckRegistry()
{
RegistryKey key64 = Registry.CurrentUser.OpenSubKey("Software\\HWiNFO64\\VSB");
RegistryKey key32 = Registry.CurrentUser.OpenSubKey("Software\\HWiNFO32\\VSB");

if (key64 != null)
{
HWiNFO.RegistryKey = "Software\\HWiNFO64\\VSB";
key64.Close();
key64.Dispose();
log.Debug("HKCU\\Software\\HWiNFO64\\VSB was found.");
ReadVSB();
LoadGrid();
}
else if (key32 != null)
{
HWiNFO.RegistryKey = "Software\\HWiNFO32\\VSB";
key32.Close();
key32.Dispose();
log.Debug("HKCU\\Software\\HWiNFO32\\VSB was found.");
ReadVSB();
LoadGrid();
}
else
{
HWiNFO info = new HWiNFO
{
Index = 0,
Sensor = "No registry values found."
};
log.Error("No registry values found.");
HWiNFO.HWList.Add(info);
LoadGrid();
IsHWiNFORunning();
}
}
#endregion Check registry for HWiNFO64 and HWiNFO32

#region Check to see if HWiNFO is running
private void IsHWiNFORunning()
{
Expand All @@ -102,19 +141,13 @@ private void IsHWiNFORunning()
MessageBoxButton.OK,
MessageBoxImage.Error);
}
else
{
log.Debug("HWiNFO is running");
ReadVSB();
LoadGrid();
}
}
#endregion Check to see if HWiNFO is running

#region Read registry and add values to a list
private void ReadVSB()
{
using (RegistryKey key = Registry.CurrentUser.OpenSubKey("Software\\HWiNFO64\\VSB"))
using (RegistryKey key = Registry.CurrentUser.OpenSubKey(HWiNFO.RegistryKey))
{
HWiNFO info = new HWiNFO();
if (key != null)
Expand Down Expand Up @@ -148,13 +181,6 @@ private void ReadVSB()
}
}
}
else
{
info.Index = 0;
info.Sensor = "No registry values found. Is HWiNFO running and configured correctly?";
log.Error("No registry values found. Is HWiNFO running and configured correctly?");
HWiNFO.HWList.Add(info);
}
}
}
#endregion Read registry and add values to a list
Expand All @@ -172,7 +198,8 @@ private void LoadGrid()
private void RefreshData()
{
HWiNFO.HWList.Clear();
ReadVSB();
CheckRegistry();
//ReadVSB();
List<HWiNFO> sortedList = HWiNFO.HWList;
sortedList.Sort();
HWGrid.ItemsSource = sortedList;
Expand Down Expand Up @@ -296,7 +323,7 @@ private void BtnSearch_Click(object sender, RoutedEventArgs e)
#region Window events
private void Window_Loaded(object sender, RoutedEventArgs e)
{
IsHWiNFORunning();
CheckRegistry();
}

private void Window_Closing(object sender, CancelEventArgs e)
Expand Down Expand Up @@ -330,7 +357,7 @@ private void ResetCols()
private void UserSettingChanged(object sender, PropertyChangedEventArgs e)
{
PropertyInfo prop = sender.GetType().GetProperty(e.PropertyName);
var newValue = prop?.GetValue(sender, null);
object newValue = prop?.GetValue(sender, null);
switch (e.PropertyName)
{
case "ShadeAltRows":
Expand Down
4 changes: 2 additions & 2 deletions HWiNFOVSBViewer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.3.174")]
[assembly: AssemblyFileVersion("0.1.3.174")]
[assembly: AssemblyVersion("0.1.4.207")]
[assembly: AssemblyFileVersion("0.1.4.207")]

0 comments on commit 9eb1f0b

Please sign in to comment.