views:

293

answers:

4

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")
A: 

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

hallie
This is not what he's asking, he wants to know if there is a default program associated with the file extension.
SLC
this is how we(Henk) understants his original question....
hallie
+3  A: 

You may want to look at http://stackoverflow.com/questions/24954/windows-list-and-launch-applications-associated-with-an-extension and IQueryAssociations.

Ian G
+2  A: 

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");
KMan
+1  A: 

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

See the following article

Ahmed Said