问题
I need the service to stop and be removed on its uninstall, but I don't want it to start on install. The problem is, the start attribute on the ServiceControl
element does not provide an option to disable starting. Or am I just missing it?
I'm using this for my service control element:
<ServiceControl Id="StartService"
Start="install"
Stop="both"
Remove="uninstall"
Name="Remec.AteService"
Wait="yes" />
回答1:
As per the documentation, the start
attribute is optional, so simply omit it entirely.
<ServiceControl Id="StartService"
Stop="both"
Remove="uninstall"
Name="Remec.AteService"
Wait="yes" />
回答2:
Leave out the Start
attribute.
来源:https://stackoverflow.com/questions/4590089/wix-servicecontrol-stop-a-service-on-uninstall-but-dont-start-it-on-install