I'm using the following code to define a service dependency on SQL Server:
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.ServicesDependedOn = new[] { "MSSQLSERVER" };
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
This works in two machines, one with SQL Server and the other with SQL Server Express. But when I installed the service in the clients server, it failed because the SQL Server Express service name was different (SQLSERVEREXPRESS). Is there any way of defining a dependency that works in both situations? Thanks.