自动安装使用ClickOnce部署更新 [英] Automatically install updates with ClickOnce deployment

查看:534
本文介绍了自动安装使用ClickOnce部署更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的部署与的ClickOnce部署的项目。但是,当我做到了这样,它是在最终用户机器要求在一个对话框:




XXXX的一个新的版本可用。是否要立即下载?




但我的最终用户的的有一个鼠标或键盘。所以,我的意思是:它必须采取自动更新,但绝不能问这个对话框在客户端。我如何使用ClickOnce部署实现这一目标?


解决方案

看起来你可以通过构建改变一些属性做到这一点。



的http:/ /blog.jnericks.com/configuring-msbuild-to-auto-update-clickonce





  1. MinimumRequiredVersion - 告诉ClickOnce的,当它更新此
    应用应该升级到这个版本(然而,这并不
    力的ClickOnce执行更新)。正如你可以看到我们设置这个
    到相同的版本号,该ApplicationVersion设置为使
    的MinimumRequiredVersion始终是最新的版本。

  2. 的UpdateMode =前景 - 告诉ClickOnce的更新应用程序
    打开之前它

  3. UpdateRequired = TRUE - 告诉ClickOnce的自动执行
    更新
  4. $ b $。 b



没有MSBuild的情景:




  1. 右键点击你的项目,并选择属性

  2. 转到底部的发布选项卡离开

  3. 点击更新按钮来打开应用程序更新对话框

  4. 选中应用程序应该检查更新

  5. 选择应用程序启动之前,

  6. 选择指定此应用程序所需的最小版本的

  7. 输入的发布版本,你可以在底层的发布窗口的最低版本看看。不幸的是,你必须改变这种每发布。有可能是这是汽车的一种方式,虽然。



然后发布应用程序并进行测试。这是在本地测试应用程序的工作对我罚款



编辑:看起来像一些人已经获得所需的最低版本更新,可能想看看他们的< A HREF =htt​​p://stackoverflow.com/questions/202491/automatically-increment-minimum-required-version-in-a-clickonce-deployment>解决方案的。



编辑2:图像显示,其中版本是很重要的:





另外,请注意我有,每个出版的检查自动递增的修订。每次你进入属性项目时,该版本将是最新的。你通常只需要更改版本的版本部分,在应用程序更新窗口,以匹配发布选项卡中的修订。


I wanted to deploy my project with ClickOnce deployment. But when I did it like that, it was asking in a dialog box at the end user machine:

A new version of XXXX is available. Do you want to download it now?

But my end users don't have a mouse or keyboard. So my intention is: It must take the updates automatically, but it must NOT ask that dialog box at the client side. How do I achieve this by using ClickOnce deployment?

解决方案

Looks like you can do this by changing some properties in the build.

http://blog.jnericks.com/configuring-msbuild-to-auto-update-clickonce

  1. MinimumRequiredVersion - Tells ClickOnce that when it updates this application it should update to this version (however this does not force ClickOnce to perform the update). As you can see we set this to the same version number that the ApplicationVersion is set to so that the MinimumRequiredVersion is always the latest version.
  2. UpdateMode=Foreground - Tells ClickOnce to update the application before it is opened.
  3. UpdateRequired=True - Tells ClickOnce to automatically perform the update.

No MSBuild scenario:

  1. Right Click your project and select Properties
  2. Go to the "Publish" tab on the bottom left
  3. Click the "Updates..." button to open the Application Updates dialog
  4. Check "The application should check for updates"
  5. Select "Before the application starts"
  6. Check "Specify a minimum required version for this application"
  7. Enter the Publish Version that you can see in the underlying Publish window as the minimum version. Unfortunately, you have to change this every publish. There might be a way for this to be auto, though.

Then publish the application and test it. This was worked fine for me on a local test application.

Edit: looks like some people have been getting the minimum required version to update, might want to look into their solutions.

Edit 2: Image showing where versioning is important:

Also, note I have "Automatically increment revision with each publish" checked. Every time you go into the Properties for the project, that version will be up to date. You'll generally just have to change the "Revision" part of the Version in the "Application Updates" window to match the "Revision" in the Publish tab.

这篇关于自动安装使用ClickOnce部署更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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