The following answer suggests a directory search to detect an installed Net Core 3.1.x windows desktop runtime: How to detect net core 3.1 windows desktop app runtime is installed
For example, the following code detects version 3.1.4 of the 32-bit Net Core desktop runtime:
<!-- check for 32-bit runtime -->
<util:DirectorySearch
Id="NetCoreDesktopSearch"
Variable="NetCoreDesktopInstalled"
Path="[ProgramFilesFolder]dotnet\shared\Microsoft.WindowsDesktop.App\3.1.4"
Result="exists"
/>
This worked for a while, but with recent updates (presumably with Windows updating to a later runtime version, i.e. version 3.1.14) there seem to be machines where the "3.1.4" folder has disappeared while the actual desktop runtime version 3.1.4 remains installed (i.e. as displayed with dotnet --info
). As a result, the installer may try to run the .Net Core Desktop 3.1.4 installer again, which in turn fails with error 0x80070666 - Another version of this product is already installed.
and the installation is aborted.
DirectorySearch
is therefore not a reliable way to detect a specific version.
Is there a better way?
Can the official .Net Core Desktop installer be instructed to silently succeed if a newer version is present on the system?
Is there an officially sanctioned way to detect a particular .Net Core Desktop version in an installer (i.e. registry search)?
User contributions licensed under CC BY-SA 3.0