0

I have created a windows service in visual studio 2012. I can install the service using installutil, but I need to distribute the service to a client.

How can I build a MSI? There are wwalk throughs in vs2008, but they don't seem to apply to 2012, as 2012 has install shield limited edition and I cannot find Custom Actions anywhere..

user2206329
  • 2,792
  • 10
  • 54
  • 81
  • 1
    Check out [WiX - the Windows Installer Toolkit](http://wixtoolset.org/) - free XML-based installer that creates `.msi` as its output – marc_s Jul 08 '14 at 14:21
  • You could use the standard service control tool sc.exe as explained here: http://stackoverflow.com/questions/15085856/using-sc-to-install-a-windows-service-and-then-set-recovery-properties – Axel Kemper Jul 08 '14 at 14:25
  • you can also create a .bat that uses installutil, and distribute that to the client. – ionutioio Jul 08 '14 at 14:26

1 Answers1

1

Do you have to distribute an MSI?

If all you want is to install the service then the application itself should do it. Use a ServiceInstaller. Add a main argumnet so when you run app.exe /install it isntalls the service (and perhaps /uninstall removes it).

The following topic explains the details: How to: Add Installers to Your Service Application. The ServiceInstaller has code example.

You should use an MSI if you have more complex requirements, if you want your app to appear in the Control Panel/Add-Remove programs, if you want to add 'Repair' installs, if your installation needs to provide options (CLI or UX).

Remus Rusanu
  • 288,378
  • 40
  • 442
  • 569
  • are you saying that I should add another project to my service project and make that new project a console application and then from their call the service installer? I have followed on how to add installers to your service application – user2206329 Jul 09 '14 at 10:39
  • You can make your service application be also the service installer, no need for two projects. Just switch in `main`. – Remus Rusanu Jul 09 '14 at 12:24