How to install redistributable package of .NET Framework with Wix?

老子叫甜甜 提交于 2019-12-06 09:27:27

Here is how to bootstrap the .NET framework.

1) Be sure you have the .NET 3.5 and Windows Installer 3.1 boostrappers on your build machine. They should be installed with VS. They can likely be found here: C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\DotNetFX35.

2) Edit the wix project file. - Right click on the project, select unload - Right click again, and edit the wixproj

3) Add the following item group:

<ItemGroup>
  <BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
    <ProductName>Windows Installer 3.1</ProductName>
  </BootstrapperFile>
  <BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1">
    <ProductName>.NET Framework 3.5</ProductName>
  </BootstrapperFile>

4) Add the following at the end of the project file

    <Target Name="AfterBuild">
  <GenerateBootstrapper ApplicationFile="$(TargetFileName)" ApplicationName="My Application Name" BootstrapperItems="@(BootstrapperFile)" ComponentsLocation="Relative" CopyComponents="True" OutputPath="$(OutputPath)" Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\" /></Target>

5) Now build. The resulting setup.exe & msi should install the framework.

Scott

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!