NsisDotNetChecker icon indicating copy to clipboard operation
NsisDotNetChecker copied to clipboard

[Feature Request] Add .NET 6.0 Desktop Runtime check support

Open RichardDale opened this issue 3 years ago • 2 comments

.NET 6.0 on Windows comes with three runtimes:

  1. .NET Desktop Runtime 6.0 (includes Windows desktop components AND core components - the base core Runtime is not needed with this one)
  2. ASP.NET Core Runetime (used mainly for Internet Informatiom Server support)
  3. .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

RichardDale avatar Apr 21 '22 04:04 RichardDale

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/

A9G-Data-Droid avatar Oct 03 '22 16:10 A9G-Data-Droid

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

A9G-Data-Droid avatar Oct 03 '22 16:10 A9G-Data-Droid