Search code examples
c#visual-studio-2012windows-servicesinstallationsetup-deployment

Installing a windows service without a set up project


I have written a standard simple .net windows service in c#. Now I am looking to install it and running it.

On MSDN, it says to add an installer to the project and create a setup project to deploy and install the service. http://msdn.microsoft.com/en-us/library/aa984263%28v=vs.71%29.aspx

I have added installers to my project. However I have Visual Studio 2012 which does not come with the setup project templates. What is the alternative to this?

Also I know that the Visual Studio Command Prompt can call InstallUtil.exe which supposedly can install services. What is the difference between this and installing it with the set up project? Would I still need installers in my project if I use InstallUtil.exe?


Solution

  • You can use installutil.exe in an elevated command window for this, as you stated.

    The Installer tool is a command-line utility that allows you to install and uninstall server resources by executing the installer components in specified assemblies. This tool works in conjunction with classes in the System.Configuration.Install namespace.

    This is no different from using the installer, as far as getting the service setup.