Since there is no Wix equivalent to Netfx.wixext for .NET Core (i.e. specifying built in Ids to detect and require runtimes), I can't seem to find a way to correctly install .NET Core and also account for various conditions such as a newer version existing in the same version family (i.e. 3.1).
I've tried to utilize the .NET Core installer executable directly in a burn project, but the problem arises that detection only seems to be able to be achieved with Directory or File searches. This results in failing to detect build version differences correctly since I can't detect "3.1.*".
I tried to build a custom action for the Wix Bundle to programmatically detect and set properties based upon installed .NET Core versions -- But of course I realized that Burn bundles cannot have custom actions.
What other options do I have to install runtimes and detect future version of the same .NET Core Family (Major.Minor)?
Here is the snippet of wix code which is relevant:
<?xml version="1.0"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
<Fragment>
<Variable Name="DotnetCoreRuntime31InstallDir" Value="[ProgramFiles64Folder]dotnet\shared\Microsoft.NETCore.App\3.1.12" />
<util:DirectorySearch Id="DotnetCoreRuntime31Installed" Path="[DotnetCoreRuntime31InstallDir]" Variable="DotnetCoreRuntime31Installed" Result="exists" />
<WixVariable Id="DotnetCoreRuntime31WebDetectCondition" Value="DotnetCoreRuntime31Installed" Overridable="yes" />
<WixVariable Id="DotnetCoreRuntime31WebInstallCondition" Value="" Overridable="yes" />
<Variable Name="AspNetCoreRuntime31InstallDir" Value="[ProgramFiles64Folder]dotnet\shared\Microsoft.AspNetCore.App\3.1.12" />
<util:DirectorySearch Id="AspNetCoreRuntime31Installed" Path="[AspNetCoreRuntime31InstallDir]" Variable="AspNetCoreRuntime31Installed" Result="exists" />
<WixVariable Id="AspNetCoreRuntime31WebDetectCondition" Value="AspNetCoreRuntime31Installed" Overridable="yes" />
<WixVariable Id="AspNetCoreRuntime31WebInstallCondition" Value="" Overridable="yes" />
<PackageGroup Id="AllNetCoreRuntime31">
<ExePackage
Name="dotnet-runtime-3.1.12-win-x64.exe"
SourceFile="Resources\dotnet-runtime-3.1.12-win-x64.exe"
InstallCommand="/install /quiet /norestart /log "[DotnetCoreRuntime31Log]""
RepairCommand="/repair /quiet /norestart /log "[DotnetCoreRuntime31Log]""
UninstallCommand="/uninstall /quiet /norestart /log "[DotnetCoreRuntime31Log]""
PerMachine="yes"
DetectCondition="!(wix.DotnetCoreRuntime31WebDetectCondition)"
InstallCondition="!(wix.DotnetCoreRuntime31WebInstallCondition)"
Vital="yes"
Permanent="yes"
Protocol="burn"
LogPathVariable="DotnetCoreRuntime31Log"
Compressed="yes" />
<ExePackage
Name="aspnetcore-runtime-3.1.12-win-x64.exe"
SourceFile="Resources\aspnetcore-runtime-3.1.12-win-x64.exe"
InstallCommand="/install /quiet /norestart /log "[AspNetCoreRuntime31Log]""
RepairCommand="/repair /quiet /norestart /log "[AspNetCoreRuntime31Log]""
UninstallCommand="/uninstall /quiet /norestart /log "[AspNetCoreRuntime31Log]""
PerMachine="yes"
DetectCondition="!(wix.AspNetCoreRuntime31WebDetectCondition)"
InstallCondition="!(wix.AspNetCoreRuntime31WebInstallCondition)"
Vital="yes"
Permanent="yes"
Protocol="burn"
LogPathVariable="AspNetCoreRuntime31Log"
Compressed="yes">
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>