I asked this question in a more general design context before. Now, I'd like to talk about the specifics.
Imagine that I have app.exe
running. It downloads update.exe
into the same folder. How would app.exe
copy update.exe
over the contents of app.exe
? I am asking specifically in a C++ context. Do I need some kind of 3rd mediator app? Do I need to worry about file-locking? What is the most robust approach to a binary updating itself (barring obnoxious IT staff having extreme file permissions)? Ideally, I'd like to see portable solutions (Linux + OSX), but Windows is the primary target.
app.exe
to app_old.exe
update.exe
to app.exe
Renaming of a running i.e. locked dll/exe is not a problem under windows.