.NET: Microsoft Technologies based on the .NET software framework. Runtime: An environment required to run apps that aren't compiled to machine language.
Hello @Bevan Thomas and thank you for reaching out.
Yes, this is feasible. A WiX Burn bundle is a good way to handle this.
You can use WiX's DotNetCoreSearch to detect whether the required .NET 10 Windows Desktop Runtime is already installed. If it is not installed, the Burn bundle can install the runtime before installing your application's MSI.
Microsoft provides the .NET 10 Windows Desktop Runtime as an architecture-specific executable installer rather than a standalone MSI. Download the appropriate x64, x86, or Arm64 installer here: https://dotnet.microsoft.com/en-us/download/dotnet/10.0.
As an example of how to do this, you can create the following two files in your project folder:
Bundle.wixproj
<Project Sdk="WixToolset.Sdk/7.0.1">
<PropertyGroup>
<OutputType>Bundle</OutputType>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<AcceptEula>wix7</AcceptEula>
</PropertyGroup>
<ItemGroup>
<Compile Include="Bundle.wxs" />
<PackageReference Include="WixToolset.Bal.wixext"
Version="7.0.1" />
<PackageReference Include="WixToolset.Netfx.wixext"
Version="7.0.1" />
</ItemGroup>
</Project>
Bundle.wxs
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal"
xmlns:netfx="http://wixtoolset.org/schemas/v4/wxs/netfx">
<Bundle
Name="your name"
Manufacturer="manufacturer"
Version="0.0.1.0"
UpgradeCode="a3ac6b7c-29fa-4fe2-88fa-36430c8a0eb2">
<BootstrapperApplication>
<bal:WixStandardBootstrapperApplication
Theme="hyperlinkLicense"
LicenseUrl="" />
</BootstrapperApplication>
<netfx:DotNetCoreSearch
Id="DotNet10DesktopX64Search"
RuntimeType="desktop"
Platform="x64"
MajorVersion="10"
Variable="DotNet10DesktopX64Version" />
<Chain>
<ExePackage
Id="DotNet10DesktopRuntimeX64"
SourceFile="windowsdesktop-runtime-10.0.14-win-x64.exe"
InstallArguments="/install /quiet /norestart"
RepairArguments="/repair /quiet /norestart"
UninstallArguments="/uninstall /quiet /norestart"
DetectCondition="DotNet10DesktopX64Version"
Permanent="yes"
Vital="yes"
PerMachine="yes" />
<MsiPackage
Id="test"
SourceFile="bin\Debug\quickstart.msi"
Vital="yes" />
</Chain>
</Bundle>
</Wix>
Important notes:
- Make sure
RuntimeType,Platform, andMajorVersionmatch the .NET 10 Desktop Runtime your application requires. - Make sure the
SourceFileof<ExePackage>points to the correct .NET 10 Desktop Runtime installer. - Likewise, the
SourceFileof<MsiPackage>should point to your application's MSI. - The
UpgradeCodein<Bundle>uses an example GUID that I generated. I recommend generating your own GUID and replacing it.
This example assumes that you already have a working application MSI and are familiar with creating a basic WiX bundle. For further configuration or WiX-specific options, please refer to the WiX documentation, as WiX itself is a third-party tool.
Regarding the custom action approach, I would recommend using the Burn bundle instead of launching the .NET installer from a custom action inside your MSI. This keeps the prerequisite installation at the bootstrapper level: Burn checks for and installs the required .NET runtime first, and then proceeds with your application's MSI.
If you found my response helpful or informative, I would greatly appreciate it if you could follow this guide for your confirmation. Thank you.