I would not recommend restricting your deployment to the same server you are installing on. SQL Server instances are expensive, and the likelihood you'll be able to install your app and your database on the same server would be unusual. Looking for whether the SQL services are active will restrict you to a local database deploy--it's pretty likely that your installer won't even be able to see the remote SQL services because of firewalling.
That natural approach with SQL Server 2005/2008/2012 is to make your database deployment revolve around the connection string used to deploy that database to either a local server/instance or a remote server/instance. The parts of the connection string that are of interest in an installer are: 1) the server[,port]\instance; 2) whether Windows Authentication or SQL Authentication will be used; 3) and if SQL Authentication is used, what the SQL Username and SQL Password are. Validate your connection string first, then setup your chosen deployment technology around that connection string, and only then deploy. -- John Merryweather Cooper Build & Install Engineer - ESA Jack Henry & Associates, Inc.® Shawnee Mission, KS 66227 Office: 913-341-3434 x791011 jocoo...@jackhenry.com www.jackhenry.com -----Original Message----- From: Freedman, Mark P. [mailto:mark.freed...@jhuapl.edu] Sent: Tuesday, May 28, 2013 9:47 AM To: wix-users@lists.sourceforge.net Subject: [WiX-users] Wix Windows Service installer depdendent on SQL Server I'm looking to make a wix installer for a service that will be dependent on sql server. The name of the SQL Server service is dependent on the name of the SQL instance and other things. In a windows depoloyment project, I'm scanning the list of services that start with MSSQL$ and setting them as a dependency. How does this translate to WiX? I'd prefer to do it in an automated way if possible. Any advice is appreciated. Thanks. ServiceController[] services = ServiceController.GetServices(); var dependentServices = new List<string>(); foreach (ServiceController service in services.Where(x => x.ServiceName.StartsWith("MSSQL$"))) { dependentServices.Add(service.ServiceName); } Mark Freedman ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users NOTICE: This electronic mail message and any files transmitted with it are intended exclusively for the individual or entity to which it is addressed. The message, together with any attachment, may contain confidential and/or privileged information. Any unauthorized review, use, printing, saving, copying, disclosure or distribution is strictly prohibited. If you have received this message in error, please immediately advise the sender by reply email and delete all copies. ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users