-2

I need to add Pdf reader element in programm C# WinForms for display PDF-file. I tried to use Pdfium SDK, but it's commercial library. Just I tried using Adobe Active X Library. But for run this application wants to installed Adobe Reader. If Adobe Reader is not installed, need to run AdobeReaderSetup.exe. How can I check Adobe Reader installed?

  • Have you checked: http://stackoverflow.com/questions/39198669/check-if-adobe-reader-is-installed-before-using-it – Vax Jan 12 '17 at 11:37

1 Answers1

0

You can get the list of installed applications by iterating over the Registry key SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

using(Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"))
{
    foreach(string skn in key.GetSubKeyNames())
    {
        using(RegistryKey subkey = key.OpenSubKey(skn))
        {
            if(subkey.GetValue("DisplayName").Contains("Adobe PDF")) {
               // Process accordingly
            }
        }
    }
}
Roy Dictus
  • 32,551
  • 8
  • 60
  • 76