Wix 和 .NET Framework(先决条件)
当客户端计算机上尚未安装所需的 .NET Framework 时,如何让 Wix 包下载该包? 我已经有条件检查已安装的 .NET 版本,但我不确定如何在找不到时下载并安装它。
ClickOnce 通过检查属性页中的先决条件自动执行此操作。 由于一些其他要求,我只需要在 Wix 中完成即可。
谢谢!
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.
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.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
从 WiX 3.6 开始现在支持此功能。 该文档仍然很粗略,但对于初学者来说,请查看如何:使用以下命令安装 .NET Framework刻录。
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 中,使用引导程序,您需要添加 .net 4.0 作为下载的先决条件(如果需要的话):
a) 将文件 WixNetFxExtension.dll 的引用添加到您的 Bootstrapper / 托管 Bootstrapper 应用程序项目中
b) 添加以下内容您链中的第一个项目..
确实是它!
更多信息请参见:wixnetfxextension 文档
In wix 3.6 using the bootstrapper all you need to add .net 4.0 as a prerequisite to be downloaded if required is..
a) Add a reference to the file WixNetFxExtension.dll into your Bootstrapper / managed Bootstrapper app project
b) Add the following as the first item in your chain..
That really is it!
Further info here : wixnetfxextension documentation
Wix 将包含自己的引导程序,称为burn。 看看:http://robmensching.com/博客/帖子/2009/7/14/Lets-talk-about-Burn
Wix will contain its own bootstrapper called burn. Have a look at: http://robmensching.com/blog/posts/2009/7/14/Lets-talk-about-Burn
DotNetInstaller 也被许多开发人员推荐为良好且可靠的引导程序。
更新:更新了 DotNetInstaller 的 URL,2017 年 8 月。
DotNetInstaller is also recommended by many developers as good and solid bootstrapper.
UPDATE: updated URL to DotNetInstaller, Aug 2017.
2017 年 8 月更新:
这个非常好的答案现在看来已经过时了。 另请阅读“线程”中的其他答案,了解一些不同的“引导程序选项”。
Wix 创建的 MSI 包无法做到这一点。 Windows Installer 相当有限,不允许一个 MSI 文件(您的安装程序)调用另一个 MSI 文件(.NET Framework 安装程序)。
您必须创建一个所谓的引导程序(setup.exe 文件),它可以检查指定的先决条件,根据需要下载并安装它们,然后启动您的 MSI 安装程序。
创建引导程序的一种方法是使用 Visual Studio 或 MSBuild 任务GenerateBootstrapper。 这是一个提供更多详细信息的链接:
如果您只想向用户提供单个安装程序,您可能需要创建一个包含 setup.exe 文件和 MSI 包的自膨胀安装包。 您可以使用 iexpress,随 Windows 一起提供。
这是另一个给出示例的链接: http://www.clariusconsulting.net/blogs/pga/comments/42831.aspx
UPDATE Aug 2017:
This very nice answer now appears outdated. Please also read the other answers in the "thread" for a few different "bootstrapper options".
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).
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.
One way to create the bootstrapper is by using Visual Studio or the MSBuild task GenerateBootstrapper. Here's a link giving more details:
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.
Here's another link giving an example: http://www.clariusconsulting.net/blogs/pga/comments/42831.aspx