Skip to content

Detecting if .Net Core Runtime is installed, reliably #2925

@angelsix

Description

@angelsix

I'm creating a Wix installer, and it appears nobody has any solid way to detect if the .Net Core runtime is installed on a machine...?

Now I don't want to package my application with publish -r and have the entire framework in the folder for every application, I would prefer to have the client install the .Net Core runtime (or do it for them).

  1. Is that the correct approach/expected way to distribute .Net Core apps to the outside world? i.e. with dotnet publish (no -r) and have the runtime installed on the clients machine, like .Net Framework does.

  2. If so, there appears no registry entry, no system flag, no hard-folder path for determining if .Net Core Runtime is installed. So how do we detect it for an installer prerequisite?

Some people look at hard-coded paths like C:\Program Files\dotnet\shared\Microsoft.NETCore.App however that can change and is not localized either so won't work well.

I've spotted a few registry entries but nothing I feel confident in ascertaining the installed versions of .Net Core from without confirmation.

So can anyone shed some light on a solid future-proof way of detecting the presence of .Net Core runtimes on a machine?

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions