Monday, August 4, 2008

Determine MOSS or WSS


There is no direct way to determine whether MOSS is installed over WSS throught Object model,
So we can just check the existence of profile service on the farm. Profile service comes along only with MOSS so we can ensure MOSS is installed by this snippet.


string
isapiFolder = SPUtility.GetGenericSetupPath("ISAPI");
string userProfileServicePath = Path.Combine(isapiFolder, "UserProfileService.asmx");
bool SharePointServerInstalled = File.Exists(userProfileServicePath);

No comments: