2

How can I install a windows service with WiX? I already did everything on the setup to install a normal .exe but what musst I do to install and start a service?
Do I only need to copy this in my product.wxs and everything will work?

I want to install it via the Setup and set the Service to autostart on Windows Startup. And I want to delete the Service with the Setup mean it will stop the Service and uninstall it. It would be great to if I can update the Service too with a new Setup mean it will stop the Service, uninstall it, install the new one and start it.

Is all this possible with the Code from the answere I linked?

Damien_The_Unbeliever
  • 234,701
  • 27
  • 340
  • 448
SomePerson
  • 581
  • 1
  • 6
  • 18

1 Answers1

3

"Hello Service": The markup you link to should generally work, but it is a bit involved and complex. You can normally get away with fewer constructs. Here is a full-featured, self-contained practical example on github: How to create a Windows Service MSI Installer Using WiX (I didn't actually test it, but it looks good).

IsWiX: Chris Painter also has a sample on how to install services: https://github.com/iswix-llc/iswix-tutorials/tree/master/windows-service

Documentation: ServiceInstall, ServiceControl.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164