0

I found the solution of getting a list of installed programs from here. Get installed applications in a system

but not getting all installed programs, missing some programs in the list. How can I get all program list without skip

here is my code..

        try
        {
            object line;
            string softwareinstallpath = string.Empty;
            string registry_key = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
            using (var baseKey =RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64))
            {
                using (var key = baseKey.OpenSubKey(registry_key))
                {
                    foreach (string subkey_name in key.GetSubKeyNames())
                    {
                        using (var subKey = key.OpenSubKey(subkey_name))
                        {
                            line = subKey.GetValue("DisplayName");
                            if (line != null)
                            {
                                listBox1.Items.Add(line);

                                if (line != null && (line.ToString().ToUpper().Contains("SKYPE")))
                                {
                                    MessageBox.Show("SKYPE");
                                }
                                if (line != null && (line.ToString().ToUpper().Contains("QBFC")))
                                {
                                    softwareinstallpath = subKey.GetValue("InstallLocation").ToString();
                                    listBox1.Items.Add(subKey.GetValue("InstallLocation"));
                                    break;
                                }
                            }
                        }
                    }
                }
            }

        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message + Environment.NewLine + ex.StackTrace);
        }
  • Can you see the applications you're missing in "Programs and features" or "Add or remove programs"? – ProgrammingLlama Oct 03 '18 at 09:00
  • There is A LOT of places you need to check: x86 registry, x64 registry, Win32_Product WMI class, prefetch folder, Program Files folder. Can you tell us what exactly you trying to do? – vasily.sib Oct 03 '18 at 09:03
  • You can check in `@"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall"` for 32 bits applications installed on a 64 bits Windows – Cid Oct 03 '18 at 09:06
  • Thanks for your reply. I have checked with my 'Progreamms and features' window in control panel. Its not fetch all list of programs installed in my machine ex. "Skype" is showing in my control panel, not showing in listbox – Johnson Kumar Oct 03 '18 at 09:07
  • actually i need to integrate our product to Intuit. So after successful login in my product, I have to check QBFS13Installer is already installed or not. If not installed, then have to start the installation process. – Johnson Kumar Oct 03 '18 at 09:11
  • There's applications, such OneDrive that aren't located in `HKLM\SOFTWARE\...\Uninstall` but in `HKCU\Software\Microsoft\Windows\CurrentVersion\Uninstall` – Cid Oct 03 '18 at 09:12
  • Issue resolved. replacing @"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall" instead of @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" thanks have a good day!.. – Johnson Kumar Oct 03 '18 at 09:18

0 Answers0