c# – ClickOnce应用程序跳过要求更新(如果选择了跳过,则会启动失败)

我更新了我的ClickOnce应用程序,然后当用户运行时,系统会询问他们是否要安装新版本。

我正在高度控制的环境中工作。当更新可用时,必须安装(与旧版本不能保证与数据库向后兼容)。

另一个选择是如果跳过按钮失败(这也很好)。

我需要一些方法来阻止他们运行旧版本的应用程序。

本文回答您的问题。我指着你的文章,而不是发布一个答案,因为文章中的一切都值得我们知道。

http://www.sayedhashimi.com/CategoryView,category,ClickOnce.aspx

以下是文章的相关摘录:

Forcing ClickOnce Updates

One of the big selling points of
ClickOnce is automatic updates. One of
the common questions I get with regard
to updates is “How can I force an
update on the user?”

There are three things to know with
respect to forcing updates on users:

1) If your application is an online
application, your users will always
run the latest version; online
applications get downloaded everytime
the application is accessed. Thus,
with online applications, you get
forced-updates by default.

2) If your application is an installed
application, you can force updates by
using the MinimumRequiredVersion
attribute. If you publish your
application using Visual Studio, you
can set this property from the Updates
Dialog.

3) The last thing to note is that if
your application is an installed
application (and you have not set the
MinimumRequiredVersion attribute)
ClickOnce will prompt the user with an
“Update Available” dialog ONLY if the
user launches the application from the
Start Menu shortcut. That is, if an
application is an installed
application and the user launches the
application from a URL, ClickOnce
forces the update.

我还发现另一篇很好的文章:

ClickOnce: Bringing Ease and Reliability to Smart Client Deployment

http://stackoverflow.com/questions/1638066/clickonce-application-skips-asking-for-an-update-or-fail-launch-if-skip-is-sele

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:c# – ClickOnce应用程序跳过要求更新(如果选择了跳过,则会启动失败)