Can I request the current OS version in WinRT?

Using WinRT, I can determine if there is a current OS:

  • Windows RT
  • Windows 8 Core
  • Windows 8 Pro
  • Windows 8 Ent

Is it possible?

Please note that the question (http://stackoverflow.com/questions/10125324/get-os-version-in-winrt-metro-app-c-sharp) seems to be a duplicate, but it is a preliminary issue of the question. Most of the API has been changed in all versions. The answer to this question was that it was impossible. It's true? Surely not.

+4
source share
4 answers

Yes, using webview seems like a reliable and fairly quick way to get the processor you are running on. Define pro versus enterprise. No. I can not find a way.

But if you are interested in how to identify the processor and move from there? See my answer here: fooobar.com/questions/200176 / ...

0
source

If this can be done, it is not easy, and it will need to be done from the data that you can get about the running system. Unfortunately, the documents are very unclear. For example, the GetNativeSystemInfo function is enabled in a Metro style application. See this list .

However, the documents for GetNativeSystemInfo cite an example on how to get a version of an OS that uses several APIs that are not in the Metro-style application list, but the example is still in the Metro docs. It is also unclear what the answer from GetNativeSystemInfo will be on the ARM processor.

The bottom line is that this is a bad approach and inevitably causes the fragility of your code. My advice is not to try to do this.

+1
source

You may get the OS version number with some risk that it might be wrong to use the device APIs to get the driver version number for a low-level system component such as HAL.

http://attackpattern.com/2013/03/device-information-in-windows-8-store-apps/ contains additional information and sample code (disclosure, I wrote this message and code)

0
source

Take a look at this:

http://msdn.microsoft.com/en-us/library/windows/apps/windows.applicationmodel.packageid.architecture.aspx

var architecture = packageId.architecture; var package = Windows.ApplicationModel.Package.current; var packageId = package.id; var version = packageId.version; var output = [ "Name: \"" + packageId.name + "\"", "Version: " + version.major + "." + version.minor + "." + version.build + "." + version.revision, "Architecture: " + packageId.architecture, "ResourceId: \"" + packageId.resourceId + "\"", "Publisher: \"" + packageId.publisher + "\"", "PublisherId: \"" + packageId.publisherId + "\"", "FullName: \"" + packageId.fullName + "\"", "FamilyName: \"" + packageId.familyName + "\"", "IsFramework: " + package.isFramework ]; 
-1
source

Source: https://habr.com/ru/post/1435526/


All Articles