I'de like to nominate this bit of code (if approved as an 'acceptable practice') for the wiki. It seems Wine-devel gets this question at least once a month. Thoughts?
Not acceptable practice. See e.g. the old faq entry: http://www.winehq.org/site/docs/wine-faq/index#HOW-CAN-I-DETECT-WINE
--Juan