we have an windows forms app built through .NET 6 and during the installation we need to check whether .NET 6 is installed or not. The installation is built through NSIS Installer. I see couple of places where the version can be checked.
1) Registry
For x64 versions HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App
For x86 versions HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x86\sharedfx\Microsoft.WindowsDesktop.App
2) .NET installed location - %Programfiles%\dotnet\host\fxr
Are these the right approaches ? Any .NET experts /Microsoft experts can advise on the right approaches?