How do I update the running EXE?

ε祈祈猫儿з 提交于 2019-12-02 03:55:03

问题


How do I substitute the running EXE with a new version ?


回答1:


You can do it this way:

  1. rename the running EXE,
  2. copy the new version to the old name,
  3. when the new version is started have it delete the renamed EXE

Note that this is definitely not recommended behaviour.




回答2:


Short: By stopping it, and starting the new version.

Long: When you start an application, the operating system loads the application in memory (or at least the parts that are needed) and sets up all the memory regions the run the program. While the application is running, the binary (what you call the EXE) is not needed anymore by the operating system.

If you would want to replace code in a running application, you could do that by replacing the code segment. I do not know if it is possible or easy in Windows. Another option could be to use some kind of plugin system, where you can replace parts of the application while it is still running.



来源:https://stackoverflow.com/questions/12261007/how-do-i-update-the-running-exe

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