静默更新 Windows 服务
我已经构建了一个 Windows 服务,现在我希望它自动更新。我读过有关创建第二个服务来执行此操作或不同的程序的内容,无法使用单击一个,myBuild?有人知道吗?最好的方法是什么?我可以只更换组件吗?
I have built a Windows service, now I want it to auto-update. I have read about a creating a second service to do that or different program , cant use click one, what about myBuild? Does anyone know it? What is the best way? Can I just change assemblies?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您希望服务在执行更新时运行,我之前为实现此目的所做的操作如下:
If you want your service to run while you are performing an update, here is what I had done before to achieve this:
要重新启动您的服务,请执行以下操作
然后在您的服务中执行以下操作
To restart your service do
Then in your service do
您可以修改 Windows 服务,使其只是主应用程序的运行程序,并具有更新主应用程序的功能。
因此,您将拥有:
Service.exe:运行 Application.exe,监视远程位置以获取 Application.exe 的更新。将启动/停止事件发送到 Application.exe
Application.exe :曾经是您的 Service.exe。接收开始/停止事件。
You could modify your Windows Service so that it is simply a runner for your main application, and has the functionality to update your main application.
So you would have:
Service.exe: Runs Application.exe, monitors remote location for updates to Application.exe. Sends start/stop events to Application.exe
Application.exe : What used to be your Service.exe. Recieves start/stop events.