>One consideration is if, as part of any patching process, the service needs to be stopped, then restarted. If so, then as the EXE is stopping itself, it would first have to tell something else to restart it at a future time. You might be able to leverage a service that is likely already running (e.g. the Task Scheduler Service) to do this, rather than relying on another updater EXE that's running all the time, or spawning a separate process to handle the restart.
>
>If you don't necessarily need to stop the service, you're looking at self-modifying code. Besides being complex, this has a modern drawback that some viruses use the technique, so AV programs will usually red-flag it.
>
>As a side issue, you may be concerned about the literal loss of service while your service is stopped, then restarted. One workaround is to have a pool of 2 or more identical services, each of which is capable of handling requests. You could then update them one at a time, making sure at least one is left running at any given time.
>
>Another radical possibility is to have two separate but identical service instances running, which don't update themselves, but are capable of updating
each other. That could give you the availability benefits of having a pool, but at the same time not needing anything more than the service's EXE itself.
Thanks for a very detailed answer. Yes, we also had that concern about using a patch mode about virus related issues. The fact that the service might be down during the update is not an issue. This update will only take a few seconds or maybe a minute or two at most and doesn't have any impact on its job.