If you start a background thread using ThreadPool.QueueUserWorkItem, I think you could have Thread.Sleep there, and when you close the service, you won’t have to do anything with it. I think that Timer Tick will automatically create a thread for you when it starts to tick, so you will have to do even less if you used it (out of two timer timers, I think you will agree that you want to achieve better, better choice )
It definitely looks like what would be better done by the planner, as you say. I don’t know if you can do it directly in InstallShield, but perhaps you could create a small console application that you run from the installer, which, based on a command line argument, either talks to the Windows GUI - http: // msdn.microsoft.com/enus/library/windows/desktop/aa383614(v=vs.85).aspx to register yourself or complete the task that you want to achieve (i.e. -install - configure it in the schedule, no arguments don't do what you need to do once a day).
I think this is a C ++ API, so you can do a little p / invoke or, better, just have some managed C ++ in the libaray class and reference it using the C # console application.
source share