Skip to content

Commit

Permalink
Read Framework version
Browse files Browse the repository at this point in the history
  • Loading branch information
uholeschak committed Dec 12, 2024
1 parent db58ff0 commit 715d554
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions EdiabasLib/EdiabasLibConfigTool/FormMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,13 +181,17 @@ private int GetNetFrameworkVersion()
{
try
{
using (RegistryKey ndpKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32).OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"))
using (RegistryKey localMachine32 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32))
{
if (ndpKey != null && ndpKey.GetValue("Release") != null)
using (RegistryKey ndpKey = localMachine32.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\"))
{
if (ndpKey.GetValue("Release") is int releaseKey)
if (ndpKey != null)
{
return releaseKey;
object releaseValue = ndpKey.GetValue("Release");
if (releaseValue is int releaseKey)
{
return releaseKey;
}
}
}
}
Expand Down

0 comments on commit 715d554

Please sign in to comment.