it seems
GetValueNames
return empty collection. check like below, you will get the sub key names and display names.
RegistryKey branch = Registry.CurrentUser;
branch = branch.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall", Microsoft.Win32.RegistryKeyPermissionCheck.ReadSubTree, System.Security.AccessControl.RegistryRights.ReadKey);
var subKeyNames =branch.GetSubKeyNames();
var DisplayNames = new List<string>();
foreach (string subkey_name in branch.GetSubKeyNames())
{
using (RegistryKey subkey = branch.OpenSubKey(subkey_name))
{
DisplayNames.Add((string)subkey.GetValue("DisplayName"));
}
}
And check below answers as well
C#: How to get installing programs exactly like in control panel programs and features?[
^]