I want to detect whether adobe reader is installed using VB6. Also if detected that it's not installed, what would be the best solution?
Access "HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\Acrobat Reader" and enumerate its subkeys. By that you get the versionnumbers of the installations of "Adobe Reader" (formerly "Acrobat Reader") that exist on this computer.
You might also have a look at http://pdftohtml.sourceforge.net/ If you cannot find an application which is able to parse pdf files, you may also convert it to html and access it with a webbrowser, which is available on most operating systems.
There are crude ways (checking for files on Program files directory), but I'd recommend you declare full-registry functions (not getSetting from vb) as in http://www.windowsdevcenter.com/pub/a/windows/2004/06/15/VB_Registry_Keys.html and fetch
HKEY_CLASSES_ROOT\.pdf
If that's there, something capable of reading pdfs is there (which is what you want, right?).
As a bonus, HKEY_CLASSES_ROOT\.pdf\OpenWithList has a list (wow) of registered applications that open .pdf files... the key names on that list are programs you can invoke from vb using shell("start "+ OpenAppName)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With