Search code examples
c#visual-studio-2010shadow-copyappdomainsetup

c# shadowcopy example


I need to update my executable with also the dll linked..

I've read about the AppDomainSetup.ShadowCopyFiles but I'm in trouble trying the right steps to do what I need

the question are:

  • the shadow copy I need to create only when I notify an update or each time I launch my executable?
  • what is the right step to copy and update the dlls and the .exe?

Solution

  • Creating a shadow copy is not going to update your application. The general sequence of auto-updating requires a third application that manages the process. It looks something like this.

    1. Main application finds update and downloads update files to temp location
    2. Main application launches updater application and terminates itself
    3. Updater application copies update files over main application files
    4. Updater application launches main application and terminates itself

    Obviously there is going to be error handling logic built in to this. But that is the general idea. Shadow copies are nowhere in there.