views:

165

answers:

3

This will be short: Is there any command line tool to replace .manifest file in application?

// Edit: I mean in resources of EXE.

+1  A: 

I'm unaware of command line tools to do it, though you could knock your own up pretty easy using the resource API's, there's definately calls to do this:

http://msdn.microsoft.com/en-us/library/ms648049(VS.85).aspx

Lloyd
+2  A: 

The command line tool is brcc32.exe which comes with Delphi. Supposing your manifest is in the file named manifest.xml:

1) Create file manifest.rc with the following contents:

1     24     manifest.xml

2) Compile the .rc file with brcc32

3) Add the resulting .res file to your .dpr file:

{$R manifest.res}

Alternatively, instead of steps 2) and 3) just add the .rc file to your .dpr file:

{$R 'manifest.res' 'manifest.rc'}

This will include compiling the resource in the IDE build process so you don't have to invoke brcc32 manually.

Note: Also disable "Enable runtime themes" in Project Options since that would replace your explicit manifest resource. Instead, include the appropriate Common Controls declaration in your own manifest.

TOndrej
Thanks, that did the trick
Thermalcake
This technically is part of the build process so you're not actually replacing any resource in an existing executable...
Lloyd
+1  A: 

There is a command-line tool to modify resources: ResHacker. http://www.angusj.com/resourcehacker/

Chris Thornton