Similar to iTunes' 'Link Maker' (http://www.apple.com/itunes/linkmaker/faq/). Through web browser, iTunes webpages is capable of finding out if itms://
has been registered on client workstation, hence displaying correct message ('View in iTunes' button or 'Download iTunes' promotion banner).
How is this conducted?