wixwix4

Is net 7 supported for building Wix 4 custom actions?


I'm converting a solution to net 7. It contains WiX installer, recently converted to WiX 4 and a custom action project, currently in net 4.7.2.

In the end of the custom action project build it runs a command line tool from WiX:

$(NuGetPackageRoot)wixtoolset.dtf.customaction\4.0.1\tools\WixToolset.Dtf.MakeSfxCA.exe" "$(TargetDir)InstallUtilsPackage.dll" "$(NuGetPackageRoot)wixtoolset.dtf.customaction\4.0.1\tools\x64\SfxCA.dll" "$(TargetPath)" "$(TargetDir)CustomAction.config" "$(NuGetPackageRoot)wixtoolset.dtf.windowsinstaller\4.0.1\lib\net20\WixToolset.Dtf.WindowsInstaller.dll"

In net 4 it works ok. Now I make an attempt to convert this project to net 7.

I use the same command line except I changed a path to WixToolset.Dtf.WindowsInstaller.dll to netstandard2.0

$(NuGetPackageRoot)wixtoolset.dtf.customaction\4.0.1\tools\WixToolset.Dtf.MakeSfxCA.exe" "$(TargetDir)InstallUtilsPackage.dll"  "$(NuGetPackageRoot)wixtoolset.dtf.customaction\4.0.1\tools\x64\SfxCA.dll"  "$(TargetPath)"  "$(TargetDir)CustomAction.config"  "$(NuGetPackageRoot)wixtoolset.dtf.windowsinstaller\4.0.1\lib\netstandard2.0\WixToolset.Dtf.WindowsInstaller.dll"

And here I realize that even before this command is called, even if I disable it, the build fails with the following error:

EXEC : error : Invalid argument: WixToolset.Dtf.WindowsInstaller.dll must be included in the list of support files. If using the MSBuild targets, make sure the assembly reference has the Private (Copy Local) flag set.

Obviously WixToolset.Dtf.MakeSfxCA.exe in net 7 case gets called automatically and fails.

This answer: Wix4 C# CustomAction project compile error - WixToolset.Dtf.WindowsInstaller reference suggests that WiX 4 custom actions are not compatible with any net core version. But I would like to be sure about it, that would be strange for a new WiX.


Solution

  • that would be strange for a new WiX.

    Why? WiX is an Open Source project. If no one is interested in contributing the work, it won't be done...

    ...and hosting .NET Core turns out to be particularly hard work.

    We learned a lot of lessons trying to host it in Burn for custom BoostrapperApplications. In fact, all of the .NET Core hosting is being rewritten in WiX v5 to provide the same functionality without hosting .NET Core because there are fundamental issues. Thankfully, we didn't try to do the same for custom actions because they'd be similarly broken.

    tl;dr

    No, it is not supported.

    PS: I should note that at FireGiant, we are investigating alternatives via AOT. That may show up as a feature of our HeatWave product.