是否必须执行ClickOnce更新? [英] Making ClickOnce Updates Mandatory?

查看:69
本文介绍了是否必须执行ClickOnce更新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前正在构建的应用程序中让我检查更新,它为用户提供了安装或不安装更新的选项。
我希望它无论如何都将自动安装更新。
如何进行此更改?

Currently in an application I'm building I have it check for updates, and it gives the user the option to install or not to install the updates. I want it to just automatically install the updates no matter what. How can I make this change?

推荐答案

自动更新



选择ClickOnce更新策略进行必要的更新

一个选项是设置软件的自动更新,并通过在部署清单中设置最低要求版本来将其标记为必需。您可以在Visual Studio的属性对话框中,或通过使用以下标记的配置进行设置:< deployment install = true minimumRequiredVersion = 1.0.0.0> 。最低要求的版本检查程序集的版本,如果至少不是您在此处指定的版本,它将强制进行更新。

One options is to set up automatic updates to your software and mark them as required by setting the minimum required version in your deployment manifest. You can set this in the properties dialog in Visual Studio, or through configuration with the following tag: <deployment install="true" minimumRequiredVersion="1.0.0.0">. The minimum required version checks the version of your assembly, and if it is not at least what you specify here it will force an update.

如何:添加按需编程更新

另一个可以让您更好地控制更新时间和频率的选项是通过编程进行更新。您可以使用ClickOnce API在部署服务器上检查任何更新,并在应用程序运行后安装它们。您可以控制应该安装哪些更新,如何安装更新以及如何将更新通知用户。如果您的应用程序通常是长时间运行的实例,则还可以将计时器设置为每隔一段时间在后台运行一次,以进行更新。

Another option that will allow you more control of when and how often the update occurs is to do the updates programmatically. You can use the ClickOnce API to check for any updates on the deployment server and install them once your application has been run. You can have far more control over what updates should be installed, how they are installed, and how you notify the user of the updates. If your application is generally a long running instance, you could also set up timers to run in the background every so often to do the updates as well.

这里是一个示例间隔轮询的实现:示例

Here is an example implementation that polls on an interval: Example.

您还可以结合使用以上两种更新方法。

You can also combine the above two update methods.

这篇关于是否必须执行ClickOnce更新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆