user599807
user599807

Reputation:

Check if Skype is installed

I have tried to fix a method that checks if the user has Skype installed on his computer. This I fixed / come up with:

  1. I have Skype installed on my computer
  2. I've fixed a method that loops through all of my installed programs
  3. My method finds my installed programs BUT it can not find skype although it is installed. But my method finds other programs that are in the same directory.

Does anyone have any ideas on how to check if Skype is installed on the computer?

The method I used are simillrar to this one:

Method to loop through all installed programs

Upvotes: 5

Views: 3258

Answers (1)

Reinaldo
Reinaldo

Reputation: 4666

Just use the registry:

using Microsoft.Win32;

    //Function uses Microsoft.Win32 to check registry value of
    //HKEY_CURRENT_USERSoftwareSkypePhoneSkypePath and returns false if
    //the key is null
    private bool isSkypeUser()
    {
        RegistryKey skype = Registry.CurrentUser.OpenSubKey(@"SoftwareSkypePhone");

        if (skype != null && skype.GetValue("SkypePath") != null)
        {
            return true;
        }
        else
        {
            return false;
        }
    }

http://brcline.com/blog/?tag=skype

EDIT:

A dirty workaround is to loop through the StartMenu folders looking for the Skype shortcut or folder. You must use the following SpecialFolder enumeration:

var startMenuPath = Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms)

Hope it helps!

Upvotes: 6

Related Questions