在没有 .NET Framework 4 的计算机上安装 WPF 应用程序
我正在使用 Visual Studio 2010 创建安装包来安装 WPF 应用程序。我可以看到我可以添加 .NET Framework 4.0 作为先决条件,但是如何让他自动运行而无需手动干预?
我是否必须创建一个小程序(针对框架 1.1,因为我假设大多数机器都有 1.1)来检测 .NET Framework 4.0 是否存在,如果没有则静默安装它,或者我可以让安装程序来执行此操作。
我还必须安装 OLEDB 12 驱动程序,因为我要连接到 Access 2007 数据库,因此我还必须在运行应用程序之前运行此安装程序。
我不希望安装程序下载并安装框架,我想在安装过程中包含框架可再发行组件。
任何帮助将不胜感激。
谢谢
I am using Visual Studio 2010 to create a Setup package to install a WPF application. I can see that I can add the .NET framework 4.0 as a pre-requisite, but how do I get his to run automatically without manual intervention?
Do I have to create a small program (that targets framework 1.1 as I assume most machines have 1.1) that detects if .NET framework 4.0 is there and if not install it silently, or can I get the installer to do this.
I also have to install the OLEDB 12 drivers because I'm connecting to an Access 2007 database, so I will also have to run this installer before my application is run.
I don't want the install to download and install the framework, I want to include the framework redistributables with the setup.
Any help would be appreciated.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您想要使用 Visual Studio 2010 和 .net Framework 4 进行引导,如下所述 在这里。
You want to do bootstraping, using visual studio 2010 and .net framework 4, as explained here.
您需要在安装包中包含 .NET 可再发行可执行文件。查看这篇文章 - 它谈论的是 Widows App、VS 2008 和.NET 3.5,但同样的事情也应该适用于您。
You need to include .NET redistributable executable in your setup package. Check this article - its talking about Widows App, VS 2008 & .NET 3.5 but same thing should apply to you as well as.
在 FW 4.0 中,您可以让程序在“客户端配置文件”下运行,这是框架的轻型版本,大约需要 30MB,并且可以作为安装的一部分。仅当您的软件很轻且不使用“客户端配置文件”之外的库时,此方法才有效。
如果您的程序无法使用“客户端配置文件”进行编译,并且您需要整个框架,则无法将整个框架添加到您的安装中,您将需要提供下载链接或提供完整的固件安装程序。
有 2 个安装。轻型安装实际上从 MS 下载填充包,而完整安装则大约 300MB。两者都可以从 MS 下载。
In FW 4.0 you can have you program running under a "Client Profile" that is a light version of the framework that takes around 30MB and can be part of the installation. This works only if your software is light and doesn't use libraries that are outside of the "Client Profile".
If your program can't be compiled using a "Client Profile" and you need the whole framework there is no way of adding the whole framework to your installation and you will need to supply a link for download or supply the full FW installation with your program.
There are 2 installations. a light installation that actually downloads the fill package from MS and a full installation, around 300MB. Both can be downloaded from MS.