Flag -starttype of procedure twapi::create_service could have additional option corresponding to "Automatic (Delayed Start)" value in Windows Service Manager.
Could be something like auto_start_delayed.
It's not the same. "demandstart" does not start service automatically, only manually by user (or another app). "Automatic (Delayed Start)" starts service automatically on system start but with some delay after another services have started.
I see in twapi start type is set by ChangeServiceConfig, but this delayed start can only be set by ChangeServiceConfig2 API (same that is used in twapi::set_service_description and twapi::set_service_failure_actions): https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-changeserviceconfig2w
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe this is the same as the demandstart value for createservice -starttype.
It's not the same. "demandstart" does not start service automatically, only manually by user (or another app). "Automatic (Delayed Start)" starts service automatically on system start but with some delay after another services have started.
I see in twapi start type is set by ChangeServiceConfig, but this delayed start can only be set by ChangeServiceConfig2 API (same that is used in twapi::set_service_description and twapi::set_service_failure_actions): https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nf-winsvc-changeserviceconfig2w
Ah I see. Added call set_service_delayed_start which will be in 4.4
That will do. Thank you!
Last edit: RP. 2020-07-08