dqm4977 2019-03-19 17:53
浏览 109
已采纳

运行时如何自我更新应用程序

I have a self updating standalone application in windows. The current update process goes as:

  1. Main app downloads file from server and save it to disk with a temporary name.
  2. Main app executes a secondary app with parameters.
  3. Main app exits.
  4. Secondary app renames temporary file to overwrite main app.exe.
  5. Secondary app executes main app.
  6. Secondary app exits.

The above works. But I'm wondering if its possible to do this without using a secondary app? Particularly with Golang.

  • 写回答

2条回答 默认 最新

  • douyou8047 2019-03-19 18:09
    关注

    The executable file is locked while running. However you can rename the file even though you can't delete it. So download the new app to a temporary file, make your app rename the app.exe to app-old.exe and then rename the temp file to app.exe. Also delete app-old.exe before downloading beginning the rename craze.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料