I changeed the startup type of the service from Automatic to Automatic Delayed.
I just turn the "serviceInstaller" property "DelayedAutoStart" to true and it worked.
after reboot it started again.
But I would like to question another thing,
I have already made a txt file that keeps the start time of the service, the interval and when it stops.
But when I close the computer it doesnt keeps the time that the service stopped. Do you know how to do this?
Or if the power cut how to keep record for this