CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2004
    Posts
    429

    Question Is the best way to update a running Service by using another service? [C#]

    I need to find a reliable way to update a running Windows Service (Service.exe).
    The service is run under the LocalSystem account whereas the logged-in user is in a non-admin User account.

    My current solution would be as follows:
    - The Service.exe checks for updates (files) regularily
    - When an update it found it starts another service (Launcher.exe) that would stop the Service.exe, copy over the files, restart Service.exe, then stop itself

    After doing some online-reading and from some of my previous forum posts I beleive this would be the appropriate solution - but before I go ahead I wanted to check with all the guru's and see if I am forgetting something important or if there is a better way.

    I did read-up on some method of self-updating (loading & unloading assemblies, etc...) but it just seemed very unsure and I need this to be as robust as possible - if it fails it means someone needs to manually intervene.

    Any help or hints would be much appreciated.
    Thanks,

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Is the best way to update a running Service by using another service? [C#]

    I don't believe Launcher.exe needs to be a service, it's just needs to run under an account that has sufficient permissions to stop the main service, replace the files that need replacing, and restart the service.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured