Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

check program installed c#

public static bool checkInstalled (string c_name)
{
    string displayName;

    string registryKey = @"SOFTWAREMicrosoftWindowsCurrentVersionUninstall";
    RegistryKey key = Registry.LocalMachine.OpenSubKey(registryKey);
    if (key != null)
    {
        foreach (RegistryKey subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))
        {
            displayName = subkey.GetValue("DisplayName") as string;
            if (displayName != null && displayName.Contains(c_name))
            {
                return true;
            }
        }
        key.Close();
    }

    registryKey = @"SOFTWAREWow6432NodeMicrosoftWindowsCurrentVersionUninstall";
    key = Registry.LocalMachine.OpenSubKey(registryKey);
    if (key != null)
    {
        foreach (RegistryKey subkey in key.GetSubKeyNames().Select(keyName => key.OpenSubKey(keyName)))
        {
            displayName = subkey.GetValue("DisplayName") as string;
            if (displayName != null && displayName.Contains(c_name))
            {
                return true;
            }
        }
        key.Close();
    }
    return false;
}
Comment

PREVIOUS NEXT
Code Example
Shell :: how to install tor on kali linux 
Shell :: install kismet 
Shell :: wsl python image 
Shell :: how to create a script raspberry pi 
Shell :: how to install software in linux terminal 
Shell :: firebase cli 
Shell :: how to move wsl storage 
Shell :: how to get the vimrc path 
Shell :: docker on linux 
Shell :: bash find touch 
Shell :: how to find max and min in column bash 
Shell :: apache2 default page 
Shell :: batch set from file 
Shell :: how to clone ubuntu 
Shell :: create repo with name 
Shell :: git get remote branch 
Shell :: how to download nessus to kali debian 64 bit vm 
Shell :: delete remote git branches matching pattern 
Shell :: golang compile with injected variable 
Shell :: get all changes on commit name 
Shell :: uninstall g2o 
Shell :: cli echo to file 
Shell :: how to install helm 
Shell :: tar append 
Shell :: delete ec2 from terraform 
Shell :: bash log function 
Shell :: install raspap 
Shell :: set an editor for git 
Shell :: have all changes from a local branch to a new local branch git 
Shell :: how to save changes made to models in django 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =