Warpin
Warpin

Reputation: 7043

wix: uninstall of application which uses a Service requires restart?

We developed an installer using Wix, and after uninstalling our app it suggests that we reboot the computer. It seems due to our app having installed a Windows Service.

Is there any way we can avoid reboot, maybe if we have some code which stops the service, unregisters it, etc?

Upvotes: 2

Views: 823

Answers (1)

alimbada
alimbada

Reputation: 1401

You need to use the ServiceControl element:

<ServiceControl Id="ServiceController" Start="install" Stop="both" Remove="uninstall" Name="{NameOfYourService}"/>

This will:

  • start the service after installing
  • stop the service when both installing and uninstalling
  • remove the service when uninstalling

The docs are here if you need them.

Upvotes: 3

Related Questions