2

Hi I would like to know if there's an existing implementation of checking if application(Acrobat Reader) exist in your local machine before I start to open it.

for example I want to open a pdf file and i dont have an acrobat reader, so how will I check If I have an installed program for me to open the file?.

System.Diagnostics.Process.Start("path.pdf")
KMån
  • 9,896
  • 2
  • 31
  • 41
xscape
  • 3,318
  • 9
  • 45
  • 86
  • Do you want to know if a specific application exists, e.g. "Acrobat Reader"? Or do you want to know whether there is an (unspecified) application associated with a given file type, e.g. "is there something (Acrobat Reader, Acrobat, Foxit, ...) that can open PDFs available?" – Ian G Apr 07 '10 at 09:27
  • I want to know if a specific application exists in my local machine. Thank you – xscape Apr 07 '10 at 10:21

4 Answers4

3

You may want to look at Windows: List and Launch applications associated with an extension and IQueryAssociations.

Community
  • 1
  • 1
Ian G
  • 10,709
  • 6
  • 30
  • 34
2

Programmatically, here is how you'd check if Acrobat Reader is present.

Also you may check manually, if you have acrobat reader installed; somewhere here YourInstallationDrive:\Program Files\Adobe\Reader 8.0\Reader.

And then you may open the PDF like following:

Process.Start("AcroRd32.exe", "c:\myfile.pdf");
Community
  • 1
  • 1
KMån
  • 9,896
  • 2
  • 31
  • 41
1

you can check this registery key to get the installed applications HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall

See the following article

Ahmed
  • 7,148
  • 12
  • 57
  • 96
0

use System.IO.File.Exists("Your Path")

hallie
  • 2,760
  • 19
  • 27
  • This is not what he's asking, he wants to know if there is a default program associated with the file extension. – NibblyPig Apr 07 '10 at 09:27