Detecting Adobe reader isn't entirely straightforward, as they have changed their pathing etc over the years. Also, upgrades from earlier versions have in my experience left various older files and reg settings, which is why the following code loops in descending order:
Code:
for (i=7;i>3; i--)
{
strPath = SYSTEM_PROGRAMS_DIR + "\\Adobe\\Acrobat " + i.toString()+".0\\Reader\\AcroRd32.exe"
strFile = OpenFile(strPath,false,true)
if (strFile != null)
{
<do something, return i> ....
}
}
There are various other checks but that one seems to be the simplest and has so far been reliable.
Bear in mind that a .pdf created by a certain versions of Acrobat Distiller (or similar) can be - and usually is - created to be readable by lower versions of reader, back to 4 (1999 vintage). However this isn't guaranteed! Plus there are many third-party readers around, so particularly if your app is for external use, it's worth putting up a caution rather than immediately stopping users from accessing .pdf documents.
Linnet