Strategies For Replacing Program Executable in Windows

后端 未结 3 1132
滥情空心
滥情空心 2020-12-11 08:06

I have a Windows program that needs to update itself from a server automatically.

It is already able to transfer files from the server and update + validate things l

3条回答
  •  醉酒成梦
    2020-12-11 08:56

    I like the patcher/maintenance/feature add/remove tool approach. Even if for some reason you need to update something as trivial, I see no "chicken or egg paradox" here, it is more of a "one hand washes the other" thing.

    1. Application checks server for updates, if any, check if patcher is up to date, if needed, application updates patcher
    2. Patcher is executed as a separate process, downloads the update, and notifies application to prompts to install it
    3. You agree, application quits notifying the patcher, patcher unpacks data, replaces exe, does additional stuff that may be needed by the new version and launches it and terminates

提交回复
热议问题