Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
632 views
in Technique[技术] by (71.8m points)

windows - How do I add a manifest to an executable using mt.exe?

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:sharedhl.exe.manifest" -updateresource:"r:sharedhl33m.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:sharedhl33m.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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should use /outputresource instead of /updateresource:.

The correct command line would be:

mt.exe -nologo -manifest "r:sharedhl.exe.manifest" -outputresource:"r:sharedhl33m.exe;#1"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...