-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send User-Agent header to service #182
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approved with comments
// In Windows, the API below only works if the application has a manifest file with indications to the supported OS | ||
// version (https://learn.microsoft.com/en-us/windows/win32/sysinfo/targeting-your-application-at-windows-8-1). | ||
// If the caller application does not have a manifest file, this function will just return "Windows" | ||
return IsWindows10OrGreater() ? "Windows NT 10.0" : "Windows"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is already incorrect as it's reporting Windows 10 (and there's no such thing as "Windows NT 10") on Windows 11.
WU must need this info as it has OS version specific applicability. I'm guessing it uses GetVersionEx() [ignore the MSDN warnings that have been there since windows 8] or perhaps does a registry read -- see
Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion'
If you can't find a definitive source from WU folks, LMK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see reports on the web that GetVersionEx() function returns unexpected values
Like https://stackoverflow.com/questions/58294262/getversionex-windows-10-detected-as-windows-8
The current suggestion from MSDN is to use these helper functions IsWindows10OrGreater()
That's probably going to be the best guess we can make at this point.
Windows 11 can no longer be detected programmatically and the recommendation is instead to check for capabilities available on the system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as i mention in another comment, while it's undocumented, it's been there as long as I've been at Windows which is a LONG time....for build info it's probably fine for us to use some variant of:
$cv = Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion'
'Version {0} (OS Build {1}.{2})' -f $cv.DisplayVersion, $cv.CurrentBuildNumber,$cv.UBR
which gives the same value as winver.exe, "Version 23H2 (OS Build 22631.3296)" on my dev box.
likely service team just needs a BuildNumber as that's unique across all windows builds ever, e.g.
- The first Windows 10 build number is 10240
- The last Windows 8.1 build number is 9600
- The last Windows XP build number is 3790
so maybe just send up BuildNumber and architecture ID ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool!
Created #185
Related Issues
Why is this change being made?
Service will capture and use the User-Agent header for their own telemetry to know which calls are coming from the Client library. This is a "best-effort" model and there is no service enforcement.
What is being changed?
How was the change tested?