Add ability to indicate whether Windows Service should be started on deployment
In some environments we do not want a Windows Service started after it is deployed. In the current Octopus.Features.WindowsService_BeforePostDeploy.ps1 file the service is always started. It would be great to have a flag that could prevent the service from being started.

-
The final state of the services can now be defined in the "State" field. See the table in the docs at https://octopus.com/docs/deployment-examples/windows-services#WindowsServices-HowdoesOctopusactuallydeploymyWindowsService? to see how the "State" results in the final state of the service.
-
Anonymous commented
I definitely second this feature!
-
Asad commented
Has this/will this be implemented??
-
Arnaud CORNELY commented
Agreed really a must have.
Actuallt being able to control all the other aspects of the service creation (like dependencies or recovery see https://octopusdeploy.uservoice.com/forums/170787-general/suggestions/5972285-add-support-for-setting-windows-service-recovery-o) would be very helpful. -
Corey commented
Seems this should be something easy to add, and hopefully added soon!
-
Matt Ford commented
I second this suggestion for the same reasons as many others. I don't want my service to start until everything else has succeeded, but also want it to be an automatic starter in Windows following a reboot.
-
A user also proposed an option to "Avoid restarting the service if the package was already deployed"
-
Aaron commented
This needed, as we update the app.config file after the service is deployed. The service starts before the app.config is updated and loads the wrong settings from the file
-
JH commented
We also need this feature. Currently we need to stop the entire system before a deploy and then only start it up after the completion of the full deployment. Significantly, we nedd to *control when* the services start up.
-
Marko commented
Would be nice if the Start mode can be set by a variable
-
Conrad C commented
We need this feature! postdeploy works but this would be cleaner and easier to maintain. Thanks.
-
Jason Geyen commented
I agree. There are times that database migrations need to be applied to the database before the service can be started.