Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Detect Python when installed as a Store app #5189
When Python is installed as a Store app, it does not expose the normal registry keys (because Store apps aren't allowed to write to the regular registry). It does expose the key when queried directly (e.g. as
One option is to add an explicit query for 3.7 and later keys, which raises the question of "how much later" (probably stop at 3.9 for now I'd say). Alternatively, it could use the
Direct query, rather than enumeration, works but all the paths are mangled.
Other non paths string values are correct (like SupportUrl, DisplayName, etc)
Paths read from registry are:
Paths on disk are:
I tried on 2 machines and get similar results where there's an extra
That looks like a bug in the code that writes those keys.
I found a sample for the package manager API.
Unless you run as admin, you get UnauthorizedException.
That was from a regular non-store console app, it looks like a store app with
Note that VS Code can detect it because they look in PATH and