We had a project built for Win2K, then WinXP, then Win7 that has now been converted from a 32-bit Win7 program using VS2010 to a 64-bit Win10 program using VS2017. The VS2017 project was created from scratch and the old sources where then imported and updated as needed.
When I created the new project, I set the Target Platform (in the project's Configuration, General section) to Windows 10 and since I have no special needs, I set the project to build a manifest automatically.
Today I noticed that the dialog we have that shows the current Windows version info in the program says they we are running under Windows 8.1, internal version number 6.2. When I looked up the GetVersionInfo function I found out that it "lies" for programs that do not have a manifest saying they target Windows 10.
My question is in two parts:
- Since I used the VS2017 to target Windows 10 and build the manifest automatically, why is the function that only lies to programs that are NOT targeted to Windows 10 lying to my program? Shouldn't it have built the manifest correctly if it is going to do it at all?
- If VS2017 cannot or will not correctly target my program for Windows 10, can anyone help me find an example of how to manually do that with a plain C project? (Microsoft is not helpful with comments like "just add the necessary SXS symbols to your .rc file" -- I'm not going to randomly stick code in the .rc file by hand, hoping I accidentally stick it is the right place!)
I freely admit my ignorance of the manifest stuff. To date, I have not knowingly run into any situation where I needed to know about it.
[EDIT] Just a minor comment for the "this is a duplicate" crowd. My program doesn't CARE what version of Windows it finds, but it needs to REPORT as much detail about that version as possible. We display the information in one of our dialogs (and write it to a file) that we use when supporting customers. This allows us to ensure we build a test system with the exact same Windows as the customer. The primary focus of the "duplicates" is to ensure a program is running on the correct version of Windows, while mine is reporting all of the Windows version info I can find, so to me, this is NOT actually a duplicate of the others, although the RtlGetVersion() function (thanks @RemyLebeau) appears to solve both types of problem.