Strategies For Replacing Program Executable in Windows

99封情书 提交于 2019-11-28 12:38:45
  1. Running exe downloads the new one, puts it somewhere
  2. Running exe renames itself to anything (like .exe.tmp)
  3. Running exe puts the downloaded exe where the running one is (named just like the original)
  4. Running exe starts the downloaded exe
  5. Downloaded exe checks for .exe.tmp file, if found deletes it and kills the old running process
  6. Done

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

Consider ClickOnce deployment which will help you to insall/replace/update latest version from shared location and executed.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!