oleg-shilo / wixsharp

Framework for building a complete MSI or WiX source code by using script files written with C# syntax.
MIT License
1.09k stars 172 forks source link

Dotnet tool should not be relied on for wixsharp. #1585

Closed oleg-shilo closed 4 days ago

oleg-shilo commented 1 month ago

Triggered by discussion: https://github.com/oleg-shilo/wixsharp/discussions/1582

Basically, dotnet should not be relied upon for this toolset. It is un-necessary and a poor design decision. There is no guarantee that dotnet will be present on a particular system, especially while targeting older frameworks. Possibly in future there may be redirections/additional restrictions in place on the usage (of that executable), the name may change, making using the library more difficult/error prone, etc.

oleg-shilo commented 1 month ago

WixSharp by design relies on WiX toolchain. Thus WiX Toolset needs to be deployed on the build system. WiX Toolset in turn relies on .NET SDK as a default distribution mechanism for WiX tools. Thus you need to install .NET SDK v8.0 or higher.

WixSharp has no runtime dependency on .NET SDK and it can fully function without it. However, it may still try to use dotnet.exe (part of SDK) to automatically install WiX tools if they are not present.

If for whatever reason you want to build msi on a system that does not have .NET SDK installed you need to bring all WiX tools by any other means. You will also need to disable WixSharp auto-installation of WiX Tools. You can do that starting from v2.3.0 by setting the location of all WiX tools manually:

WixTools.SignTool = @"<path>\signtool.exe";
WixTools.MakeSfxCA = @"<path>\WixToolset.Dtf.MakeSfxCA.exe";
WixTools.Heat = @"<path>\heat.exe";
WixTools.DtfWindowsInstaller = @"<path>\WixToolset.Dtf.WindowsInstaller.dll";
WixTools.WixToolsetMbaCore = @"<path>\WixToolset.Mba.Core.dll";
WixTools.SfxCAx64 = @"<path>\x64\SfxCA.dll";
WixTools.SfxCAx86 = @"<path>\x86\SfxCA.dll";