views:

103

answers:

2

What is the most reliable way to determine which version of SharePoint is installed. Whether it is WSS or MOSS. If MOSS, whether it is standard or enterprise.

I want to programmatically detect the exact SharePoint version installed..

PS: I already have posted this question http://www.sharepointoverflow.com/questions/1395/determine-which-edition-of-sharepoint-is-installed but could not find a convincing answer.

A: 

As suggested there, the probably most reliable method is to check for the availability of a feature. There is no function in the SharePoint API that can tell you if it's WSS, MOSS Standard, or MOSS Enterprise.

Modery
+1  A: 

You could try to use SPFarm.Local.BuildVersion or SPWebService.ContentService.Farm.BuildVersion (from this previous question) and to build a lookup table based on this: How to find the level of SharePoint you are running?

Another option is to read directly from ConfigDB database, on Versions table; you can find more information here.

Rubens Farias