如何使用 mt.exe 向可执行文件添加清单? [英] How do I add a manifest to an executable using mt.exe?

查看:23
本文介绍了如何使用 mt.exe 向可执行文件添加清单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Windows SDK 中的 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?

推荐答案

你应该使用 /outputresource 而不是 /updateresource:.

You should use /outputresource instead of /updateresource:.

正确的命令行是:

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

这篇关于如何使用 mt.exe 向可执行文件添加清单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆