Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. manifest file

manifest file

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    subramanyeswari
    wrote on last edited by
    #1

    Hi, How to read a manifest file from executable using either vc++ or sdk? Regards

    M S N 3 Replies Last reply
    0
    • S subramanyeswari

      Hi, How to read a manifest file from executable using either vc++ or sdk? Regards

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      What's a manifest file? Do you mean a .NET assembly manifest? If so, it's XML - you can read it the same way you'd read any XML file. Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      S 1 Reply Last reply
      0
      • S subramanyeswari

        Hi, How to read a manifest file from executable using either vc++ or sdk? Regards

        S Offline
        S Offline
        Saurabh Garg
        wrote on last edited by
        #3

        For that you will have to parse the PE (executable file) file yourself. I am not sure if there are functions in WinApi itself for reading PE file. You can get PE file format specification from Microsoft Portable Executable and Common Object File Format Specification[^]. Saurabh

        S 1 Reply Last reply
        0
        • M Mark Salsbery

          What's a manifest file? Do you mean a .NET assembly manifest? If so, it's XML - you can read it the same way you'd read any XML file. Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          S Offline
          S Offline
          Saurabh Garg
          wrote on last edited by
          #4

          There is manifest file for native applications also. It can either be embedded in the executable file or can be used as standalong file. It basically points to which version of CRT, MFC, and other common controls to use from winsxs. -Saurabh

          1 Reply Last reply
          0
          • S subramanyeswari

            Hi, How to read a manifest file from executable using either vc++ or sdk? Regards

            N Offline
            N Offline
            Nibu babu thomas
            wrote on last edited by
            #5

            subramanyeswari wrote:

            How to read a manifest file from executable using either vc++ or sdk?

            Resource digger[^] does it, tell me if that's what you want. I can share with you the function source which does this. Basically manifest file is a resource of type RT_MANIFEST and it's embedded into an exe as such. So what resource digger does is that it loads the exe and searches for RT_MANIFEST resource type and get's the content of the resource and saves it to an XML file then opens it with the HTML control.

            Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

            S 1 Reply Last reply
            0
            • S Saurabh Garg

              For that you will have to parse the PE (executable file) file yourself. I am not sure if there are functions in WinApi itself for reading PE file. You can get PE file format specification from Microsoft Portable Executable and Common Object File Format Specification[^]. Saurabh

              S Offline
              S Offline
              subramanyeswari
              wrote on last edited by
              #6

              thank you

              S 1 Reply Last reply
              0
              • S subramanyeswari

                thank you

                S Offline
                S Offline
                Saurabh Garg
                wrote on last edited by
                #7

                No problem, you are welcome. -Saurabh

                1 Reply Last reply
                0
                • N Nibu babu thomas

                  subramanyeswari wrote:

                  How to read a manifest file from executable using either vc++ or sdk?

                  Resource digger[^] does it, tell me if that's what you want. I can share with you the function source which does this. Basically manifest file is a resource of type RT_MANIFEST and it's embedded into an exe as such. So what resource digger does is that it loads the exe and searches for RT_MANIFEST resource type and get's the content of the resource and saves it to an XML file then opens it with the HTML control.

                  Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                  S Offline
                  S Offline
                  subramanyeswari
                  wrote on last edited by
                  #8

                  thanks. This is what exactly i am looking for. I opened my exe with your resource digger. I saw my manifest file. How to save it back to xml file. Does it do automatically ?. how to work with resource digger. Is it possible for you to share the source code. And i have one more question. I embed my manifest file in a resouece and linked that resource with exe. I ran that exe in vista. It ran with no UAC prompt. But when i tried to write into registry. It failed to do so. I used requireAdministrator in them anifest. It did not ask for credentials. Should it ask for credentials or not? if it does not ask then i want to enable UAC prompt asking for credentials there. Is it possible to do so programmtically (or) will it work if i do impersonation. Regards

                  modified on Thursday, July 3, 2008 3:16 AM

                  N 1 Reply Last reply
                  0
                  • S subramanyeswari

                    thanks. This is what exactly i am looking for. I opened my exe with your resource digger. I saw my manifest file. How to save it back to xml file. Does it do automatically ?. how to work with resource digger. Is it possible for you to share the source code. And i have one more question. I embed my manifest file in a resouece and linked that resource with exe. I ran that exe in vista. It ran with no UAC prompt. But when i tried to write into registry. It failed to do so. I used requireAdministrator in them anifest. It did not ask for credentials. Should it ask for credentials or not? if it does not ask then i want to enable UAC prompt asking for credentials there. Is it possible to do so programmtically (or) will it work if i do impersonation. Regards

                    modified on Thursday, July 3, 2008 3:16 AM

                    N Offline
                    N Offline
                    Nibu babu thomas
                    wrote on last edited by
                    #9

                    subramanyeswari wrote:

                    Does it do automatically ?.

                    Well you've got to write code to get it working. :) So the algorithm is something like this

                    1. Use FindResourceEx to find resource of type RT_MANIFEST.
                    2. Use LoadResource to load found manifest resource
                    3. Use LockResource to get real data in the resource
                    4. Save this data to an XML file and this will be your manifest file.

                    subramanyeswari wrote:

                    And i have one more question. I embed my manifest file in a resouece and linked that resource with exe. I ran that exe in vista. It ran with no UAC prompt. But when i tried to write into registry. It failed to do so. I used requireAdministrator in them anifest. It did not ask for credentials. Should it ask for credentials or not? if it does not ask then i want to enable UAC prompt asking for credentials there. Is it possible to do so programmtically (or) will it work if i do impersonation.

                    I am not so familiar with UAC in vista.

                    Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups