using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32;
namespace Component.All
{
///
/// Install Configuration
///
public enum InstallConfig
{
LytecMD,
MedisoftClinical,
}
///
/// Common Functions and Helpers Useful for Lytec, Medisoft Installing activities
///
public static class Common_MediLytec
{
///
/// Common/Ofted used #Defs/Definitions associated with Lytec/Medisoft
///
public static class MediLytecPoundDef
{
public const string BRIDGE_SERVICE_TITLE = "BridgeService";
public const string BRIDGE_SERVICE_ASSEMBLY = "BridgeService.exe";
public const string BRIDGE_SERVICE_NAME = "McKesson Bridge Service";
public const string MIRTH_SERVICE_NAME = "Mirth Connect Service";
public const string POSTGRE_SERVICE_NAME = "Mirth_Connect_PostgreSQL_Server";
public const string POSTGRE_SERVER_PORT = "5432";
}
///
/// Retrieve the Configuration (Lytec/Medisoft) from the Registry
///
/// Lytec/Medisoft
public static InstallConfig RetrieveInstallConfigFromRegistry()
{
bool bIsLytecInstalled = false;
try
{
RegistryKey reg = Registry.LocalMachine.OpenSubKey("Software\\Lytec", false);
bIsLytecInstalled = (reg != null);
if (!bIsLytecInstalled) // also check Wow64
{
reg = Registry.LocalMachine.OpenSubKey("Software\\Wow6432Node\\Lytec", false);
bIsLytecInstalled = (reg != null);
}
}
catch (Exception) { /* ignore */ }
if (bIsLytecInstalled)
return InstallConfig.LytecMD;
else
return InstallConfig.MedisoftClinical;
}
}
}