U2U Blog

for developers and other creative minds

Determine if MOSS is installed by checking the Registry key

Today I found a post that explains a way to determine if MOSS is installed by checking on the existence of certain folders. Another way is to check on the existence of its the registry key.

image

The RegistryKey class is located in the Microsoft.Win32 namespace of the mscorlib.dll.

bool isMossInstalled = false;
string keyname = @"SOFTWARE\Microsoft\Office Server\12.0";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(keyname))
{
   if (key != null)
   {
       string version = key.GetValue("BuildVersion") as string;
       if (version != null)
       {
           Version buildVersion = new Version(version);
           if (buildVersion.Major == 12)
           {
              isMossInstalled = true;
           }
        }
   }
}

In a similar way you can determine if WSS is installed. In the registry you can find the following information:

image

Translated into code:

bool isWssInstalled = false;
string keyname = @"SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\12.0";
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(keyname))
{
  if (key != null)
  {
    object wssvalue = key.GetValue("SharePoint");
    if (wssvalue != null && wssvalue.Equals("Installed"))
    {
      isWssInstalled = true;
    }
  }
}

Comments (22) -

  • seo links

    6/28/2015 4:52:42 AM | Reply

    very nice post, i certainly love this website, keep on it

  • m88

    7/1/2015 1:30:30 PM | Reply

    This really answered my problem, thank you!

  • authority source

    7/13/2015 1:56:44 PM | Reply

    I discovered your blog site on google and check a few of your early posts. Continue to keep up the very good operate. I just additional up your RSS feed to my MSN News Reader. Seeking forward to reading more from you later on!…

  • internet resources

    8/24/2015 11:40:34 PM | Reply

    WONDERFUL Post.thanks for share..more wait .. …

  • seo directory

    9/5/2015 5:15:15 PM | Reply

    Your place is valueble for me. Thanks!…

  • Krypto1000

    9/13/2015 9:50:48 AM | Reply

    You should take part in a contest for one of the best blogs on the web. I will recommend this site!

  • en iyi bahis oranları

    9/16/2015 12:14:45 PM | Reply

    I’d have to check with you here. Which is not something I usually do! I enjoy reading a post that will make people think. Also, thanks for allowing me to comment!

  • free index

    9/30/2015 9:33:00 AM | Reply

    Nice post. I learn something more challenging on different blogs everyday. It will always be stimulating to read content from other writers and practice a little something from their store. I’d prefer to use some with the content on my blog whether you don’t mind. Natually I’ll give you a link on your web blog. Thanks for sharing.

  • cosmetic brisbane

    10/2/2015 4:47:16 PM | Reply

    You made some decent points there. I looked on the internet for the issue and found most individuals will go along with with your website.

  • forex strategies

    10/4/2015 8:20:19 AM | Reply

    Spot on with this write-up, I truly think this website needs much more consideration. I’ll probably be again to read much more, thanks for that info.

  • web links

    10/14/2015 8:36:28 AM | Reply

    I’m impressed, I must say. Really rarely do I encounter a blog that’s both educative and entertaining, and let me tell you, you have hit the nail on the head. Your idea is outstanding; the issue is something that not enough people are speaking intelligently about. I am very happy that I stumbled across this in my search for something relating to this.

  • deportation lawyer

    10/21/2015 8:26:05 AM | Reply

    There are some interesting points in time in this article but I don’t know if I see all of them center to heart. There is some validity but I will take hold opinion until I look into it further. Good article , thanks and we want more! Added to FeedBurner as well

  • web directory

    10/22/2015 11:26:12 AM | Reply

    very nice post, i certainly love this website, keep on it

  • m88

    11/4/2015 8:36:11 PM | Reply

    Would you be interested in exchanging links?

  • FCPX

    11/6/2015 10:49:37 AM | Reply

    The next time I read a blog, I hope that it doesnt disappoint me as much as this one. I mean, I know it was my choice to read, but I actually thought youd have something interesting to say. All I hear is a bunch of whining about something that you could fix if you werent too busy looking for attention.

  • m88

    11/12/2015 2:27:23 AM | Reply

    Would you be interested in exchanging links?

  • sick

    11/24/2015 4:46:22 AM | Reply

    I was very pleased to find this web-site.I wanted to thanks for your time for this wonderful read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you blog post.

  • cocuk sikisi

    11/28/2015 5:41:32 AM | Reply

    Oh my goodness! an amazing article dude. Thank you However I am experiencing issue with ur rss . Don’t know why Unable to subscribe to it. Is there anyone getting identical rss problem? Anyone who knows kindly respond. Thnkx

  • ad blocker

    12/11/2015 12:22:26 PM | Reply

    I’d have to check with you here. Which is not something I usually do! I enjoy reading a post that will make people think. Also, thanks for allowing me to comment!

  • Mold Inspection

    1/4/2016 4:40:38 AM | Reply

    you have a great blog here! would you like to make some invite posts on my blog?

  • no ads

    1/6/2016 3:41:14 PM | Reply

    This is the right blog for anyone who wants to find out about this topic. You realize so much its almost hard to argue with you (not that I actually would want…HaHa). You definitely put a new spin on a topic thats been written about for years. Great stuff, just great!

Loading