NsisDotNetChecker
NsisDotNetChecker copied to clipboard
[Feature Request] Add .NET 6.0 Desktop Runtime check support
.NET 6.0 on Windows comes with three runtimes:
- .NET Desktop Runtime 6.0 (includes Windows desktop components AND core components - the base core Runtime is not needed with this one)
- ASP.NET Core Runetime (used mainly for Internet Informatiom Server support)
- .NET Runtime 6.0 (just the core components for console apps)
The first runtime is probably the highest-use case given that NSIS is usually for installing desktop apps.
Reference: https://dotnet.microsoft.com/en-us/download/dotnet/6.0
The official way to do this is found here: https://github.com/dotnet/deployment-tools/tree/main/src/clickonce/native/projects/NetCoreCheck
This is what the WiX team is doing: https://wixtoolset.org/development/wips/6264-add-dotnet-runtime-compatibility-check/
For now, the lazy way to do this is to include the installer and run it every time. If it's already installed then it does nothing. This uses the installer as the checker, which is ham fisted and slow but gets the job done.
Here is an example for .NET6 Desktop 6.0.9
Get installer: https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/runtime-desktop-6.0.9-windows-x64-installer
Section "Install .NET6 Desktop Runtime"
File /oname="$TEMP\windowsdesktop-runtime-6.0.9-win-x64.exe" windowsdesktop-runtime-6.0.9-win-x64.exe
ExecWait "$TEMP\windowsdesktop-runtime-6.0.9-win-x64.exe /install /quiet /norestart"
Delete "$TEMP\windowsdesktop-runtime-6.0.9-win-x64.exe"
SectionEnd