WiX: .Net 3.5 Prerequisite

I have a WiX installer that I would like to test on .Net 3.5 and install it if it does not exist. I have the following lines in my wixproj file:

<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> 

When I create the installer, the DotNetFX35 folder is created and there are 4 different versions of .Net (including 3.5) and the installer file in it.

I have two questions:

  • How can I include it only in version 3.5 (so that the user does not need to install 100 MB of files)?

  • How do I tell WiX to pack these files into an MSI file so that the user only downloads 1 file?

+4
source share
4 answers
  • I think you better create a separate project for the bootloader. If the web installation is sufficient, the following project template should work:

     <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <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 SP1</ProductName> </BootstrapperFile> </ItemGroup> <Target Name="Bootstrapper"> <GenerateBootstrapper ApplicationFile="MyProject.msi" ApplicationName="MyProject" BootstrapperItems="@(BootstrapperFile)" OutputPath="$(OutputPath)" Culture="en-US" CopyComponents="true" ComponentsLocation="HomeSite" Path="$(BootstrapperPath)" /> </Target></Project> 
  • The WiX team is working on Burn, the new boot device, but until it is ready for use, you can use one of the (commercial) solutions to create a self-extracting single executable file that automatically launches the "setup". exe. "

+1
source

How can I do it? 3.5 (so the user does not need to install 100 MB of files)?

You mentioned that there are "4 different versions" of .NET. Actually there are only 3: DotNetFX20, DotNetFX30 and DotNetFX35 and some updates for Windows. The reason is that .NET 3.5 and .NET 3.0 are actually mostly incremental versions on top of the .NET 2.0 libraries and runtime.

In other words, .NET 3.0 and .NET 2.0 are prerequisites for .NET 3.5. You need all of these files if your application is for .NET 3.5.

However, for some applications, only a subset of .NET 3.5, called the .NET 3.5 client profile, is required. You can try this by checking the "Client Infrastructure" checkbox in the project build settings of your visual studio.

If your application is still building and working fine with the client profile, you can change "Microsoft.Net.Framework.3.5" to "Microsoft.Net.Client.3.5". This is only 28 MB.

How do I tell WiX to pack these files into an MSI file, so the user only needs to download 1 file?

Prerequisites must be set before launching the MSI, so they cannot be part of the MSI. However, you can do the opposite: pack both the prerequisites and MSI into a self-extracting archive, for example. with WinZip Self-Extractor . A self-extracting archive may cause the extracted setup.exe file.

+3
source

To answer part 2 of your question:

The idea of ​​bootstrapper is to provide a .exe that does not have many (if any) dependencies. This ensures that you can also download files such as the Windows Installer. Because of this, bootstrapper is a .exe that contains or loads the required files.

It also ensures that when you already have a component installed, it will not be downloaded again. For this reason, you cannot pack everything for one millisecond, and also because it will mean that when there is a security patch for .NET, you must fix it. When .NET is installed using its own installer, Microsoft may release fixes for it.

+1
source

Check out dotNetInstaller http://dotnetinstaller.codeplex.com . This is the installation loader so you can use it to check and install dependencies for your application. You can also embed installers to create a single setup.exe file. Here is an excerpt from the help file "Distributing a Unified, Compressed, Executable Packaged Installation with All Prerequisites."

+1
source

Source: https://habr.com/ru/post/1305492/


All Articles