I have developed a solution which includes a Windows Service, using Visual Studio 2012. VS 2012 has removed the ability to create an installer, so I’m using a 3rd party tool for installer generation (WiX) which integrates nicely into Visual Studio.
My problem is that while WiX is able to install a service with an Automatic start/stop type, it’s unable to install a service which start up on bootup.
I have read a number of articles about starting and stopping services for non-admin users, but there seems to be some confusion about whether using a batch script with ‘net start myservice’ will actually work for a non-admin user. I’m reluctant to try something like elevating the permissions of the named user for the specified service, as it needs to work for any user who install the application suite. similarly I'm reluctant to mess with group policy because:
a) The project needs to be installed by a simple installer without the user having to fiddle with things like that b) Any user on the target machine needs to be able to start the service
So my questions are:
- Is there a nice, simple, guaranteed-to-work-for-a-non-admin-user way of starting a service?
- Is there another way to create an installer for a Windows service which is able to start the service at bootup?
- Is there a batch script or some other post build action that I can run as part of my installer that will make the service start on boot?
Any other suggestions on how to tackle this problem will be gratefully accepted.