Update: it turns out this is actually working, but the installation files were just by default being copied to the output directory. If the setup is run without them present it will just download files as necessary.
I've been reading through the documentation and followed the how to guide on installing the .NET framework in WiX, however the output of the build is very large as a result of the framework installation files being included (between 100mb and 200mb).
As I want to avoid such a large download size for end users, is it possible to make WiX use the online installer (http://www.microsoft.com/en-us/download/details.aspx?id=31) as opposed to making users who already have the framework have to download large setups?
Currently my markup is pretty much the exact same as in the documentation, but for reference to anyone who may need to see it it's as follows:
<ItemGroup>
<BootstrapperFile Include="Microsoft.Net.Framework.3.5">
<ProductName>.NET Framework 3.5</ProductName>
</BootstrapperFile>
<BootstrapperFile Include="Microsoft.Windows.Installer.3.1">
<ProductName>Windows Installer 3.1</ProductName>
</BootstrapperFile>
</ItemGroup>
<Target Name="AfterBuild">
<GenerateBootstrapper
ApplicationFile="$(TargetFileName)"
ApplicationName="Application Name"
BootstrapperItems="@(BootstrapperFile)"
ComponentsLocation="HomeSite"
CopyComponents="True"
OutputPath="$(OutputPath)"
Path="C:\Program Files (x86)\Microsoft SDKs\Windows\v6.0A\Bootstrapper\" />
</Target>
It turns out this is actually working, but the installation files were just by default being copied to the output directory. If the setup is run without them present it will just download files as necessary.
As Sunil mentioned, perhaps the simplest way to do this is with a bootstrapper. Once you have your WiX bootstrapper working, all you need to do to add .Net 4.0 as a pre-requisite 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..
<PackageGroupRef Id="NetFx40Web"/>
That's it!
The above downloads .net 4 over the internet if required. Further info and options here : wixnetfxextension documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With