.NET的ClickOnce不安装prerequisite文件? [英] .NET ClickOnce not installing prerequisite files?

查看:361
本文介绍了.NET的ClickOnce不安装prerequisite文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Crystal Reports中的.NET项目。该应用程序是使用ClickOnce分发。物联网工作的伟大,如果用户计算机上安装了水晶。然而,并非所有的最终用户使Crystal Reports在计算机上安装。这些用户收到以下错误...

I have a .NET project that uses Crystal Reports. The application is distributed using ClickOnce. Things work great if the user has Crystal installed on their computer. However, not all of the end users have Crystal Reports installed on their computers. These users are receiving the following error...

无法安装或运行应用程序。应用程序要求组装CrystalDecisions.ReportAppServer.XmlSerialize版本10.5.3700.0被安装在全局程序集缓存(GAC)第一。

"Unable to install or run the application. The application requires that assembly CrystalDecisions.ReportAppServer.XmlSerialize Version 10.5.3700.0 be installed in the Global Assembly Cache (GAC) first."

有没有办法强制的ClickOnce安装,以确保安装了prerequisite?

Is there a way to force ClickOnce installs to ensure that a prerequisite is installed?

推荐答案

没有。有很多困惑过的ClickOnce和prerequisites。

No. There is a lot of confusion over ClickOnce and prerequisites.

的ClickOnce做的没有的使用prereqs。什么也没有。 ClickOnce的文件复制从服务器到客户端的机器,并保持这些文件同步时,服务器上的文件进行更新 - 这是它。它不能放东西在GAC中,注册的dll,安装MSI文件等。

ClickOnce does nothing with prereqs. Nothing. ClickOnce copies files from a server to a client's machine and keeps those files in sync when the server files are updated - that's it. It can't put things in the GAC, register dlls, install msi files, etc.

在哪里混淆的来源是当你部署与Visual Studio。 VS做几件事情给你,当你发布了真的什么都没有做的ClickOnce。首先,它给你一些链接到您的部署创建一个很好的HTML页面。此外,它可以让你选择从几个prereqs,将创建一个引导程序的EXE你。我假设你这样做是对的Crystal Reports安装。该引导程序只是为了管理多个prereqs一个简单的方法。而不是告诉你的用户安装X,那么Y,则Z安装您的应用程序之前,引导程序,使这三个已安装的无缝,所以他们看起来好像他们是一个大的安装。它也可以跳过preREQ安装,如果用户已经拥有了。

Where the confusion comes in is when you deploy with Visual Studio. VS does several things for you when you publish that really have nothing to do with ClickOnce. For one, it creates a nice html page for you with some links to your deployment. Also, it lets you pick from several prereqs and will create a bootstrapper exe for you. I'm assuming you did this for the Crystal Reports install. The bootstrapper is just a simple way to manage multiple prereqs. Rather than telling your user to install X, then Y, then Z before installing your app, the bootstrapper makes those three installs "seamless" so they appear as if they are one big install. It can also skip prereq installs if the user already has it.

如果你注意你的HTML页面VS产生,你可以看到两个环节。一到你的。应用文件(ClickOnce部署),一个用于引导程序的EXE。你是pretty的多少在用户的摆布,必须依靠它们来阅读网页和运行引导程序,如果他们需要。唯一例外的是.Net框架,因为HTML页面可以检查通过用户代理字符串。

If you pay attention on your html page that VS generates, you can see two links. One to your .application file (the ClickOnce deployment) and one to the bootstrapper exe. You are pretty much at the mercy of the user and must rely on them to read the page and run the bootstrapper if they need to. The one exception to that is the .Net Framework since the html page can check for that through the UserAgent string.

如果他们的的运行引导程序,他们会得到错误,就像你问的人。

If they don't run the bootstrapper they'll get errors much like the one you're asking about.

一个可行的办法是写code,以检查它是否安装。它可以检查注册表或程序文件文件夹;无论你需要做的,以确保它的安装。然后正常退出,并告知用户,如果他们没有它。只要你做检查,然后再尝试加载并使用水晶组件,将工作。

One possible solution is to write code to check if it's installed. It could check the registry or the "Program Files" folder; whatever you need to do to make sure it's installed. Then exit gracefully and inform the user if they don't have it. That will work as long as you do the check before you try to load and use the Crystal assemblies.

祝你好运!如果你想出一个更好的解决方案,请回应。

Good luck! Please respond if you come up with a better solution.

这篇关于.NET的ClickOnce不安装prerequisite文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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