转换为.NET 4后的ClickOnce升级失败 [英] ClickOnce Upgrade Fails after Converting to .NET 4

查看:388
本文介绍了转换为.NET 4后的ClickOnce升级失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们的应用程序是.NET 3.5通过的ClickOnce部署。我们只是升级到.NET 4.0,并更新了pre-requisities适当。

Our application is .NET 3.5 deployed via ClickOnce. We just upgrade to .NET 4.0 and updated the pre-requisities appropriately.

安装仍然工作正常,通过设置HTML页面谁安装初次使用的用户或用户。它会自动安装.NET 4框架他们。然而,谁已经安装的应用程序,并试图通过开始菜单运行弹出提示用户:

The install still works fine for first-time users or users who install via the setup HTML page. It will automatically install the .NET 4 framework for them. However, users who already have the application installed and attempt to run it via the start menu get the prompt:

无法安装或运行此应用程序。此应用程序需要您的系统更新到微软公共语言运行库版本4.0.30319.0。更多的信息可以在这里找到(链接到MS网站)

"Unable to install or run this application. This application requires your system to be updated to the Microsoft Common Language Runtime Version 4.0.30319.0. More information can be found here" (link to MS website)

为什么它不自动安装.NET 4.0,因为它的确,当你从HTML页面中运行呢?它甚至不给下载更新的选项。我们需要一个无缝的解决方案,为客户升级到新的应用程序,而无需手动重新安装。

Why doesn't it automatically install .NET 4.0 as it does when you run it from the html page? It does not even give the option to download updates. We need a seamless solution for our customers to upgrade to the new application without re-installing manually.

推荐答案

阅读这个问题,并回答第一。

这里有什么发生在你的方案。

Here's what's happening in your scenarios.

  1. 的安装工作正常,初次使用的用户...
    其实,这样的工作对于去到HTML页面的任何用户,不只是初次使用的用户。 HTML页面有一些脚本,检查他们的用户代理字符串4.0框架。如果没有它,它给了他们一个解释,并告诉他们从一个链接到Visual Studio中创建的引导程序(SETUP.EXE)安装。这是所有独立的ClickOnce;的ClickOnce做的没有的,直到他们点击的链接。应用文件上,也运行的启动。应用文件,当它完成的setup.exe。

  1. "The install works fine for first-time users..."
    Actually, this would work for any user that went to the html page, not just first-time users. The html page has some script that checks their user-agent string for the 4.0 framework. If they don't have it, it gives them an explanation and tells them to install it from a link to the bootstrapper that Visual Studio created (setup.exe). This is all separate from ClickOnce; ClickOnce does nothing until they click on the link to the .application file or they run the setup.exe which launches the .application file when it finishes.

谁已经安装的应用程序,并试图通过开始菜单运行......用户
这里发生的,是应用程序正确更新。他们得到的最新版本。只有他们无法运行最新的版本,因为它是一个.NET 4.0中的可执行文件,它们不具备4.0框架。

"Users who already have the application installed and attempt to run it via the start menu..."
What happens here, is that the application updates correctly. They get the latest version. Only they can't run the latest version because it's a .Net 4.0 executable and they don't have the 4.0 framework.

在这一点上,你有几种选择...

At this point you have a few options...

  • 在忍受它。告诉用户他们需要访问的HTML页面,以获得4.0框架。
  • 回滚至3.5并添加自定义code到你的应用程序,检查是否4.0安装与否,警告用户,并让他们有一个链接到新的4.0 setup.exe文件。然后几个星期后升级到4.0,一旦人们不得不安装它的机会。这可能无法正常工作,如果你的用户只运行的应用程序偶尔为之。
  • 卷回至3.5和改变你的ClickOnce更新发生在应用程序启动,而不是之前后。这会给你编写自定义code,以确定是否更新可能发生或没有,告诉用户的机会。

这篇关于转换为.NET 4后的ClickOnce升级失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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