views:

1403

answers:

3

I'm trying to use mt.exe from the Windows SDK to add a manifest to an executable file that doesn't have one, using the following command line:

C:\winsdk61>mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -updateresource:"r:\shared\hl33m.exe;#1"

Unfortunately, when I do, I get this error:

mt.exe : general error c101008c: Failed to read the manifest from
the resource of file "r:\shared\hl33m.exe". The specified resource
type cannot be found in the image file.

Of course the resource wasn't found in the file - the file doesn't have a manifest, that's why I want to add one.

How can I append a manifest to an executable file? Shouldn't this be simple?

+4  A: 

You should use /outputresource instead of /updateresource:.

The correct command line would be:

mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -outputresource:"r:\shared\hl33m.exe;#1"
Cristian Adam
A: 

You can also use it like this to embed the manifest inside the EXE file:

mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -outputresource:"r:\shared\hl33m.exe;1"

A: 

If you try modify files at ProgramFiles (Win7/Vista) - run cmd as administrator.

omihaz