When StartMode is set to automatic, it means that it will start when Windows starts.
You can start the service yourself in a custom action in your installer. I assume that you already have the Installer class, and that this is already a custom action for your installation project, since the installation is installed but does not start.
Override the OnAfterInstall method in the Installer class, and you can start the service as follows:
protected override void OnAfterInstall(IDictionary savedState) {
base.OnAfterInstall(savedState);
ServiceController sc = new ServiceController("MyServiceName");
sc.Start();
}
However, the planned task is a good way.
source
share