1

I'm writing a cross-platform application and I really need some basic info about the system. Not just for switching it (I could use compile variables, since I have the same code linked in platform-specific projects).

So don't tell me that knowing the platform and architecture info is useless:
Windows RT and c#

Can anybody provide me with this info, because I don't have any easy way to get it by my-self (I have no emulator/device to work with, I'm using a netbook with linux installed on it, so no VT-d capability and so on).

P.S. Please just avoid posting something like: "use qemu, use xxx, yyyy" etc. Consider that somebody might be looking for this info as well.

Community
  • 1
  • 1
Salaros
  • 1,444
  • 1
  • 14
  • 34
  • 2
    Neither of those methods are available from WinRT apps. – mletterle Dec 10 '12 at 18:53
  • Why? I think that 'cmd /C set && pause' should work on WindowsRT. As for Environment.OSVersion.Platform.ToString() output, you just have to create a Windows 8 app and display the string above on the UI. – Salaros Dec 10 '12 at 19:07
  • @Salaros `Environment.OSVersion` and `GetEnvironmentVariable` do not exist for Windows Store apps, period. The only way to get an app onto RT is through the Windows App store, so you cannot use these APIs. – vcsjones Dec 10 '12 at 19:12
  • Please be careful with RT-related tagging. [See meta](http://meta.stackexchange.com/q/152477/135887). – Charles Dec 10 '12 at 19:12
  • 2
    The Environment class in the .NET for Windows Store Apps subset does not contain an OSVersion property, neither does it contain a GetEnvironmentVariable(string) method. Only properties and methods designated with the green "bag" icon on the following page are available for WinRT apps: http://msdn.microsoft.com/en-us/library/z8te35sa.aspx – mletterle Dec 10 '12 at 19:13
  • Wow, thanks @mletterle, I'm quite new to Windows RT... and I'm quite sure that the last time I visited MSDN (like 2 days ago) there were only XNA flags on .NET 4.5 profile docs :-/ Thank you again – Salaros Dec 10 '12 at 19:21

1 Answers1

4

Output of 'set' on a Surface RT

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\[user]\AppData\Roaming
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=SURFACE
ComSpec=C:\windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\
LOCALAPPDATA=C:\Users\[user]\AppData\Local
LOGONSERVER=\\MicrosoftAccount
NUMBER_OF_PROCESSORS=4
OS=Windows_NT
Path=C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=ARM
PROCESSOR_IDENTIFIER=ARM Family 7 Model C09 Revision 209, NVIDIA
PROCESSOR_LEVEL=3081
PROCESSOR_REVISION=0209
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\windows
TEMP=C:\Users\[user]\AppData\Local\Temp
TMP=C:\Users\[user]\AppData\Local\Temp
USERDOMAIN=SURFACE
USERDOMAIN_ROAMINGPROFILE=SURFACE
USERNAME=
USERPROFILE=C:\Users\[user]
windir=C:\windows

Ok, and the platform value:

PS C:\Users\[user]> [system.environment]::OSVersion.Platform
Win32NT

Note that this is from the desktop. For immersive/metro applications you will probably need a different api.

Bert Huijben
  • 19,525
  • 4
  • 57
  • 73
  • Thanks a lot! And what about Environment.OSVersion.Platform. Do you have any change to provide me with its output? (I know I'm asking too much, because I suppose you will need an x86/x86_64 PC with at least VS2012 Express). – Salaros Dec 10 '12 at 19:03
  • Thanks for OSVersion.Platform output :D I'll investigate more on this (it seems you cannot access that info from c# in a Windows 8 Store app) – Salaros Dec 10 '12 at 19:23