Our Sticker Tales game tracks various activities via Google Analytics using code that grew into our CSharpAnalytics open source project.
But we also want to add some system metrics that could help us answer other questions:
When is it time to exploit features of an OS update?
Do people on tablets play longer than people on laptops?
How long do various timed activities take by CPU?
Does not having a physical keyboard affect purchase flow completion?
To do this we want to record:
Processor architecture
Device manufacturer, model and form factor (category)
Windows version number
On Windows Phone and .NET this information is easily available but in Windows Store apps it is not. Microsoft have made this difficult because your application should not change it’s behavior based on this information.
The following code uses the PnPObject API to best-guess these things. It is not bullet-proof and could easily fail on machines with custom HAL drivers (I haven’t seen one of those in years) or on other language editions of Windows (not yet tried).
It is good enough in my opinion for analytics, logging or troubleshooting and for nothing more.
To use it simply:
var windowsVersion = await SystemInfoEstimate.GetWindowsVersionAsync();
var processor = await SystemInfoEstimate.GetProcessorArchitectureAsync();