R
R
Recardo_Recoly2018-02-02 20:16:06
visual studio
Recardo_Recoly, 2018-02-02 20:16:06

How to add a manifest file to a C++ project?

I was looking for half a day how to do it ... I found articles in English. Did as it was said. And it doesn’t work... And I still don’t understand how to add this manifest file to VS 2017. This is necessary in order for the GetVersionEx / GetVersion function to work correctly on Win 8.1, win 10. As I understand it, you need to write this thing

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">


<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--The ID below indicates application support for Windows Vista -->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
      <!--The ID below indicates application support for Windows 7 -->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <!--The ID below indicates application support for Windows 8 -->
      <supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
      <!--The ID below indicates application support for Windows 8.1 -->
      <supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
      <!--The ID below indicates application support for Windows 10 -->
      <supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
    </application>
  </compatibility>
</assembly>

And how and where I did not understand. Help me please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Makarov, 2018-02-02
@Recardo_Recoly

1. Create a file in the project directory, name it as you like, for example, project_name.manifest.
2. Put everything you wrote there.
3. Add a file to the project via Add -> Existing Item...
4. Go to the project properties, Manifest Tool -> Input and Output -> Additional Manifest Files, enter the name of your file there.
5. ?????
6. PROFIT: The content of your manifest will be MERGED with the content of the manifest that is generated by default.
7. You can check the result by looking in the resources of the built EXE, or set the Embed Manifest flag to No (the checkbox is next to the previous one) and look inside the file that will drop next to your built EXE.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question