0

With Microsoft Ultimate Wisdom they have changed the location of updates from Registry. I can get the updates from Windows 2003 Servers no problem. Its just that Windows 7 is no longer in:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

Any body got any other ways to get it. Preferably in C# or using WMI?

God Save Microsoft with their Wisdom

Angel.King.47
  • 7,922
  • 14
  • 60
  • 85

2 Answers2

1

For Window 7 64-bit it's in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Updates

0
private string GetX64Installedsoftware()
{
    string Software = null;
    string SoftwareKey = @"SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall";

    Software += "\r\nWINDOWS X64 Software\r\n\r\n\r\n ";
    using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(SoftwareKey))
    {
        if (rk == null)
        {
            return Software;
        }
        foreach (string skName in rk.GetSubKeyNames())
        {
            using (RegistryKey sk = rk.OpenSubKey(skName))
            {
                try
                {
                    if (!(sk.GetValue("DisplayName") == null))
                    {
                        if (sk.GetValue("InstallLocation") == null)
                            Software += sk.GetValue("DisplayName") + " - Install path not known \r\n ";
                        else
                            Software += sk.GetValue("DisplayName") + " - " + sk.GetValue("InstallLocation") + "\r\n ";
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }
    }
    return Software;
}
takrl
  • 6,356
  • 3
  • 60
  • 69