windows检测程序是否有安装

    ///    
        /// 检测程序是否有安装 
        ///    
        /// true: 有安裝, false:沒有安裝   
        private static bool CheckProgramIsInstall(string exeName)
        {
            Microsoft.Win32.RegistryKey uninstallNode = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");
            var subKeyNames = uninstallNode.GetSubKeyNames();
            foreach (string subKeyName in subKeyNames)
            {
               if (subKeyName.Contains(exeName))
                   return true;
            }
            return false;
        }


        CheckProgramIsInstall("VR mysticraft");

你可能感兴趣的:(windows检测程序是否有安装)