ClickOnce 应用程序会跳过更新请求(如果选择跳过,则启动失败)
我更新了我的 ClickOnce 应用程序,然后当用户运行时,系统会询问他们是否要安装新版本。
我在一个高度受控的环境中工作。当更新可用时,必须安装它(旧版本不能确保与数据库的向后兼容性)。
另一种选择是如果按下“跳过”则运行失败(这也可以正常工作)。
我需要某种方法来阻止他们运行旧版本的应用程序。
I updated my ClickOnce application and then when the user runs they are asked if they want to install the new version.
I am working in a highly controlled environment. When an update is available it has to be installed (backwards compatibility with the database is not ensured with old versions).
Another option is to fail the run if skip is pressed (that works fine too).
I need some way to stop them from running an old version of the application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这篇文章回答了你的问题。我向您指出这篇文章,而不仅仅是发布答案,因为文章中的所有内容都值得了解。
http://www.sayedhashimi.com/CategoryView,category,ClickOnce.aspx
以下为相关文章摘录:
我还发现了另一篇好文章:
ClickOnce:带来轻松和智能客户端部署的可靠性
This article answers your question. I'm pointing you to the article instead of just posting an answer because everything in the article is worth knowing.
http://www.sayedhashimi.com/CategoryView,category,ClickOnce.aspx
The following is the relevant excerpt from the article:
I also found another good article:
ClickOnce: Bringing Ease and Reliability to Smart Client Deployment
这对我来说非常有效。将以下内容添加到项目文件中:
请注意,项目文件中的
ApplicationVersion
不能具有类似1.0.0.*
的值,并且应在构建时递增以自动执行更新即可工作。如果使用 TeamCity,要增加版本号,请转到项目的构建配置页面并设置以下系统属性:
您还可以获得 < strong>MSBuild 按时间增加版本,如下所示:
This neatly worked for me. Add the following to the project file:
Note that
ApplicationVersion
cannot have a value like1.0.0.*
in the project file and it should be incremented at build time for auto-update to work.If using TeamCity, to increment the version number go to Build Configuration page for your project and set the following System Property:
You can also get MSBuild to increment version by time with something like this:
除了David的回答之外,只需安装AutoUpdateProjectsMinimumRequiredClickOnceVersion nuget 包 在您的项目中。一旦您将项目设置为检查更新并使用所需的最低版本,这将确保所需的最低版本始终与您当前的版本匹配(即用户将始终被迫更新到最新版本)。
In addition to David's answer, simply install the AutoUpdateProjectsMinimumRequiredClickOnceVersion nuget package in your project. Once you have your project set to check for updates and to use a minimum required version, this will handle making sure the minimum required version always matches your current version (i.e. user's will always be forced to update to the latest version).
它通过取消选中应用程序应该检查更新来起作用,并且应用程序在两个版本之后开始更新而不提示用户。
It worked me by unchecking The application should check for updates, and the application started updating without prompting the user after two versions.
要在客户端上强制更新,您必须将最低版本字段设置为等于您正在部署的当前版本,这将强制更新而不使用“跳过”选项。
To force an update on the clients you must set the minimum version field equals to the current version you are deploying, this will force the update whiout "skip" option.