Wix 和 .NET Framework(先决条件)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/427775/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Wix and .NET Framework (prerequisites)
提问by Leon Tayson
How can I have my Wix package to download the required .NET Framework when it's not yet installed in the client's machine? I already have the condition to check for the installed .NET version but I'm not sure how to have it downloaded and installed when not found.
当我的 Wix 包尚未安装在客户端的机器上时,如何让我的 Wix 包下载所需的 .NET Framework?我已经有条件检查已安装的 .NET 版本,但我不确定如何在未找到时下载和安装它。
ClickOnce does this automatically by checking the pre-requisites in the properties pages. I just need to have it done in Wix due to some other requirements.
ClickOnce 通过检查属性页面中的先决条件自动执行此操作。由于其他一些要求,我只需要在 Wix 中完成它。
Thanks!
谢谢!
回答by Dirk Vollmar
UPDATEAug 2017: This very nice answer now appears outdated. Please also read the other answers in the "thread" for a few different "bootstrapper options".
2017 年 8 月更新:这个非常好的答案现在似乎已经过时了。另请阅读“线程”中的其他答案以了解一些不同的“引导程序选项”。
The MSI package created by Wix is not able to do that. Windows Installer is rather limited and one MSI file (your installer) is not allowed to call another MSI file (the .NET Framework installer).
Wix 创建的 MSI 包无法做到这一点。Windows 安装程序相当有限,并且一个 MSI 文件(您的安装程序)不允许调用另一个 MSI 文件(.NET Framework 安装程序)。
You will have to create a so-called bootstrapper (a setup.exe file) which can check for the specified pre-requisites, download and install them as needed, and then launches your MSI installer.
您必须创建一个所谓的引导程序(一个 setup.exe 文件),它可以检查指定的先决条件,根据需要下载并安装它们,然后启动您的 MSI 安装程序。
One way to create the bootstrapper is by using Visual Studio or the MSBuild task GenerateBootstrapper. Here's a link giving more details:
创建引导程序的一种方法是使用 Visual Studio 或 MSBuild 任务 GenerateBootstrapper。这是一个提供更多详细信息的链接:
If you only want to provide a single installer to your users you might want to create a self-inflating installation package containing both the setup.exe file and your MSI package. You could do that with iexpress, which is coming with Windows.
如果您只想为您的用户提供一个安装程序,您可能需要创建一个包含 setup.exe 文件和您的 MSI 包的自膨胀安装包。您可以使用 Windows附带的iexpress来做到这一点。
Here's another link giving an example: http://www.clariusconsulting.net/blogs/pga/comments/42831.aspx
这是给出示例的另一个链接:http: //www.clariusconsulting.net/blogs/pga/comments/42831.aspx
回答by Bartek Szafko
Wix will contain its own bootstrapper called burn. Have a look at: http://robmensching.com/blog/posts/2009/7/14/Lets-talk-about-Burn
Wix 将包含自己的引导程序,称为burn。看看:http: //robmensching.com/blog/posts/2009/7/14/Lets-talk-about-Burn
回答by Yan Sklyarenko
DotNetInstalleris also recommended by many developers as good and solid bootstrapper.
DotNetInstaller也被许多开发人员推荐为优秀而可靠的引导程序。
UPDATE: updated URL to DotNetInstaller, Aug 2017.
更新:更新了 DotNetInstaller 的 URL,2017 年 8 月。
回答by Edward Brey
This is now supported as of WiX 3.6. The documentation is still sketchy, but for starters, look at How To: Install the .NET Framework Using Burn.
现在从 WiX 3.6 开始支持。该文档仍然很粗略,但对于初学者,请查看如何:使用 Burn 安装 .NET Framework。
回答by Fetchez la vache
In wix 3.6 using the bootstrapper all you need to add .net 4.0 as a prerequisite to be downloaded if required is..
在使用引导程序的 wix 3.6 中,您需要添加 .net 4.0 作为下载的先决条件,如果需要的话是..
a) Add a reference to the file WixNetFxExtension.dll into your Bootstrapper / managed Bootstrapper app project
a) 将文件 WixNetFxExtension.dll 的引用添加到您的 Bootstrapper/托管 Bootstrapper 应用程序项目中
b) Add the following as the first item in your chain..
b) 将以下内容添加为链中的第一项。
<PackageGroupRef Id="NetFx40Web"/>
That really is it!
真的是这样!
Further info here : wixnetfxextension documentation
更多信息:wixnetfxextension 文档

