需要检查应用程序已安装或不使用自定义安装类 [英] need to check already application installed or not using custom installer class
本文介绍了需要检查应用程序已安装或不使用自定义安装类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经创建一个C#安装项目的应用程序,在那个时间,而安装我还包括自定义操作 - 安装到服务器FileZilla的。安装之前FileZilla的服务器需要检查,如果它已经安装或没有,如果是单纯意味着应用程序安装,否则安装这两个应用程序和放大器; FileZilla的服务器。
没有任何安装程序类来实现此事件。等待建议
I've to create one C# setup project application, at that time while installing i also include custom actions - install to filezilla server . Before install filezilla server need to check ,if it's already installed or not, if yes means installing application alone otherwise install both application & filezilla server. is there any installer class to accomplish this event . waiting for suggestion
推荐答案
您可以尝试使用的Microsoft.Win32命名空间注册类:
You could try using Microsoft.Win32 namespace for registry classes:
string regKey = @"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall";
using (Microsoft.Win32.RegistryKey key = Registry.LocalMachine.OpenSubKey(regKey))
{
if (key.GetSubKeyNames().Any(keyName => key.OpenSubKey(keyName).GetValue("DisplayName") == "My App's Display Name"))
Console.WriteLine("Already installed...");
else
Console.WriteLine("Start installing...");
}
这篇关于需要检查应用程序已安装或不使用自定义安装类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文