0

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

soundar
  • 3
  • 1
  • 2

1 Answers1

2

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...");
    }
AksharRoop
  • 2,263
  • 1
  • 19
  • 29