Windows 应用程序的 C# 更新程序
我为我的 Windows 应用程序开发了一个更新程序应用程序。它们是同一解决方案下的不同项目,并且作为不同的进程运行。当我运行该应用程序时,它会在启动时检查更新(作为另一个进程)。当我单击更新按钮时,它尝试将文件下载到安装位置。 (我在调试文件夹中使用 .exe,我不创建安装文件)一切正常,但主应用程序(app.exe)无法被覆盖,因为它被更新过程使用。但在更新过程中,我杀死了 app.exe,并且 app.exe 也从任务管理器中消失。我找不到任何东西,更新如何使用主app.exe。有谁知道更新如何使用主应用程序?我怎样才能观看它?它在哪一行开始使用其他应用程序?
i developed an updater application for my windows app. They are different projects under the same solution and they run as different processes. when i run the app it checks for updates at startup (as another process). when i click update button it tries to download files to the installation location. (i am using the .exe in debug folder i don't create setup file) Everything works fine but the main application (app.exe) can't be overwritten because it is used by update process. but in update process i kill app.exe and app.exe goes from task manager too. i couldn't find anything, how main app.exe is used by update. has anyone any idea how update uses main app ? how can i watch it? in which line it starts using the other app?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果更新程序应用程序引用了主应用程序 exe,它将保持锁定状态。如果是这种情况,您可以从更新应用程序项目中删除对主应用程序的引用吗?这可能需要将一些代码直接移动到更新程序的源代码中。
If the updater app has a reference to the main app exe, it will keep it locked. If that's the case, can you remove the reference to the main app from the update app project? This may need moving some code directly into the updater's source.
要了解谁在处理您的流程,您应该启动 ProcessExplorer 。菜单栏中有一些间谍眼镜。只需单击它即可查看哪个进程持有您的应用程序的句柄。
To find out who has a hand on your process you should start ProcessExplorer. There are some spy glasses in the menu bar. Just click on it and see which process holds a handle to your app.
您需要自己发明吗?您可以利用现有的解决方案来实现此目的。如果 Microsoft ClickOnce 适合您的部署模型,则它支持此功能。
快速谷歌搜索也显示了一些内容:
Do you need to invent your own? There are existing solutions that you may be able to leverage that already do this. Microsoft ClickOnce supports this if it fits your deployment model.
A quick google search turns up a few things as well: