I know that there is no way to get OS version in Windows Store app, please let me explain more.
My app is a Windows Store app programming with C#. Some features of my app is depend on another desktop app (maybe it's not a good design). As I know, a third-party desktop app can not install on Windows RT, so I just want to know if my app is running on Windows RT and forbid some features of my app on Windows RT. I don't want to use GetNativeSystemInfo(), because it's a win32 API, and if I use that API, my app can't compli with any cpu.
I don't know if this is really possible or not, but you can achieve result with "Conditional compilation symbols". For example you can add
ARM
only for ARM build, and build 3 separate packages: ARM, x86 and x64. You can find a lot of articles about how to use it. This is one of them Visual Studio: Use Conditional Compilation to Control Runtime Settings for Different Deployment Scenarios.So you just need to set up for your project for ARM configuration special symbol
ARM
(like in this screenshot you seeLIVE
).After this you can use C# directives: #if, #else, #endif to hide some portion of your code for ARM build.
Yep. Here's how!
Best of luck!
Since some features of your app depend on a desktop app (which might be installed or not) you need to handle the "not-installed" state even in the x86 version of your app anyway.
What I'd do is to disable all those features per default, and on each startup I'd check if the desktop app exists. Only if it exists, I'd enable the additional features.