Col*_*len 34 windows winapi manifest mt
我正在尝试使用Windows SDK中的mt.exe将清单添加到没有的清单,使用以下命令行:
C:\winsdk61>mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -updateresource:"r:\shared\hl33m.exe;#1"
不幸的是,当我这样做时,我收到此错误:
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.
当然在文件中找不到资源 - 文件没有清单,这就是我想添加一个的原因.
如何将清单附加到可执行文件?这不应该简单吗?
Cri*_*dam 31
您应该使用/ outputresource而不是/ updateresource : .
正确的命令行是:
mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -outputresource:"r:\shared\hl33m.exe;#1"
小智 7
这适用于VS 2005:
    <?xml version="1.0" encoding="utf-8"?>
    <asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1"
     xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" 
     xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" 
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
            <security>
                <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
                    <requestedExecutionLevel level="requireAdministrator" 
                     uiAccess="false" />
                </requestedPrivileges>
                <applicationRequestMinimum>
                    <defaultAssemblyRequest permissionSetReference="Custom" />
                    <PermissionSet class="System.Security.PermissionSet" 
                     version="1" ID="Custom" SameSite="site" />
                </applicationRequestMinimum>
            </security>
        </trustInfo>
        <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
            <application>
            </application>
        </compatibility>
    </asmv1:assembly>
在可执行项目中,添加以下后期构建事件:
"$(DevEnvDir)..\Tools\Bin\mt.exe" -nologo -manifest "$(TargetPath).manifest" -outputresource:"$(TargetPath)"
希望这可以帮助.祝好运!-Matt Esterak
您还可以像这样使用它来将清单嵌入到 EXE 文件中:
mt.exe -nologo -manifest "r:\shared\hl.exe.manifest" -outputresource:"r:\shared\hl33m.exe;1"
| 归档时间: | 
 | 
| 查看次数: | 32041 次 | 
| 最近记录: |