Reputation: 4480
I am trying to install windows service, currently service is running on the system. Now i want to my stop the service install it then again start the service.
ServiceInstall Id="GPATService" Type="ownProcess" Name="Axp.Gcpt.Gpat.Worker" DisplayName="Axp.Gcpt.Gpat.Worker"
Description="Axp.Gcpt.Gpat.Worker description" Start="auto" Account="LocalSystem" ErrorControl="normal" Interactive="no" Vital="yes" />
<ServiceControl Id="GPATServiceStart" Name="Axp.Gcpt.Gpat.Worker" Stop="both" Start="both" Wait="yes" />
Upvotes: 1
Views: 381
Reputation: 20780
The sequence of actions in an install operation (including uninstall) is StopServices, DeleteServices, InstallServices, StartServices.
You have no RemoveServices option in your ServiceControl so potentially your service will never be uninstalled (by DeleteServices), so perhaps you overlooked it.
Your "start" is set to "both", and I suspect you don't want to start your service after it's been uninstalled, so that's a potential error situation.
You haven't said whether you've tried the WiX you posted and if there are any errors. If you are doing a major upgrade then other considerations may apply, so more information could be useful.
Upvotes: 1