sentry-rust icon indicating copy to clipboard operation
sentry-rust copied to clipboard

Windows context to detect edition (home vs pro etc)

Open thomaseizinger opened this issue 11 months ago • 4 comments

It would be useful to detect the Windows edition as part of the context as those can differ a fair bit in some ways.

thomaseizinger avatar Feb 02 '25 03:02 thomaseizinger

This would likely require using the Windows API directly, as I don't see a way to retrieve this information with os_info (the crate we're currently using to get the version) or other crates.

lcian avatar Feb 02 '25 14:02 lcian

Yep, it is one system-call away! https://learn.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo

I'll see if I can draft a PR for this.

thomaseizinger avatar Feb 03 '25 06:02 thomaseizinger

Nice, thank you! I was also checking that API but I don't see any mention of Windows 11 there for example.

lcian avatar Feb 03 '25 08:02 lcian

The version is covered already by the build number! Windows 10.0.26100 is for example (confusingly) Windows 11. The only missing bit is Home, Pro, Ultimate etc

thomaseizinger avatar Feb 03 '25 10:02 thomaseizinger