How to make a WiX 3.5 installer with a fully standalone .NET 4.0 installer?

Continuing the previous question I asked here , now I need to switch to vs2010.

I received the latest weekly version of WiX 3.5, version June 5, 2010.

Here are the relevant lines of my installer:

<ItemGroup> <BootstrapperFile Include="Microsoft.Net.Framework.4.0"> <ProductName>.NET Framework 4.0</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.4.5"> <ProductName>Windows Installer 4.5</ProductName> </BootstrapperFile> </ItemGroup> 

and

 <GenerateBootstrapper ApplicationFile="MySetup.msi" ApplicationName="MyProgram" BootstrapperItems="@(BootstrapperFile)" Path="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" ComponentsLocation="Relative" OutputPath="$(OutputPath)" Culture="en" /> 

However, it just doesn't work. In vs2010 there are exclamation marks next to the .NET Framework 4.0 and Windows Installer 4.5 files, and the properties page lists them as "Unknown BuildAction BootstrapperFile", and the assembly is simply not installed to install .NET 4.0 at all. Relevant Warning:

 C:\source\depot\project\vs2010\WiXSetup\WiXSetup.wixproj(68,5): warning MSB3155: Item 'Microsoft.Net.Framework.4.0' could not be located in 'C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\'. 
+7
visual-studio-2010 wix
source share
1 answer

Short answer - change

 <ItemGroup> <BootstrapperFile Include="Microsoft.Net.Framework.3.5.SP1" > <ProductName>.NET Framework 3.5 SP1</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.3.1" > <ProductName>Windows Installer 3.1</ProductName> </BootstrapperFile> </ItemGroup> <Target Name="setup"> <GenerateBootstrapper ApplicationFile="myproduct.msi" ApplicationName="myproduct" BootstrapperItems="@(BootstrapperFile)" Path="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" ComponentsLocation="Relative" OutputPath="$(cddir)" Culture="en"/> </Target> 

in

 <ItemGroup> <BootstrapperFile Include=".NETFramework,Version=v4.0" > <ProductName>.NET Framework 4.0</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.3.1" > <ProductName>Windows Installer 3.1</ProductName> </BootstrapperFile> </ItemGroup> <Target Name="setup"> <GenerateBootstrapper ApplicationFile="myproduct.msi" ApplicationName="myproduct" BootstrapperItems="@(BootstrapperFile)" Path="C:\Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper\" ComponentsLocation="Relative" OutputPath="$(cddir)" Culture="en"/> </Target> 

I realized this by going to the bootstrapper SDK directory (C: \ Program Files \ Microsoft SDKs \ Windows \ v7.0A \ Bootstrapper) on my computer for Visual Studios 2010. It has a list of projects that can read Wix and enable it for bootstrapping . Each folder has a Product.xml file. After looking at the help here to create the .NET 3.5 installer, I found that the ProductCode attribute in the Product tag seems to identify the name of the boostrap element, so when I changed the value to the link specified in C: \ Program Files \ Microsoft SDK \ Windows \ v7.0A \ Bootstrapper \ Packages \ DotNetFX40 \ Product.xml, with which he worked.

+12
source share

All Articles