Memo: Using Bho and Asynchronous Pluggable Protocol.
Searching with Google, it is easy to find relevant information and examples.
But actually, or use JavaScript method is relatively appropriate. Because of BHO or App, there is such a question: If the visitors do not have the appropriate programs, he will get a wrong warning, but can't know where you are wrong, you can't get the download URL for the installer.
JavaScript is more smart, and it is probably more common.