There are many approaches to check if MOSS or WSS is installed at specific installation site. One of the approach is to check the Windows Registry key.
If MOSS is installed, there will be registry entries in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office Server\12.0
If WSS is installed, there will be registry entries in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0
Please note that if MOSS is installed both registry entries as shown above will be exist at installation sites.
I’ve created a helper class SharePointConfig.cs which exposes method and properties which are useful to those who are interested use this approach. See code below:
The following tables list the members exposed by the SharePointMalaya.SSOHelper.SSOConfiguration type.
SharePointConfig - Initializes a new instance of the SharePointConfig class, get registry key for either MOSS or WSS.
IsMOSSInstalled - Gets a value indicating whether MOSS instance is installed.
IsWSSInstalled - Gets a value indicating whether WSS instance is installed.
BuildVersion - Gets either MOSS or WSS build version.
TemplatePath - Gets either MOSS or WSS template path.
Get source code here:
Sample Web Part