/// <summary>
/// 检测程序是否有安装
/// </summary>
/// <returns>true: 有安裝, false:沒有安裝</returns>
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");
网友评论