UAC:清单文件被忽略 [英] UAC: Manifest file is ignored
问题描述
我的可执行文件之一将一些配置写入XML文件到C:\ Program Files \ MyApp \ config.xml.它需要在Vista/Server 2008上以管理员身份运行,否则操作系统将不允许它写入该位置.
One of my Executables writes some configuration into a XML file to C:\Program Files\MyApp\config.xml. It needs to run as Administrator on Vista / Server 2008, otherwise the OS won't let it write to that location.
我包含一个名为config.exe.manifest的清单文件,用于在启动时自动请求管理权限.
I included a manifest file named config.exe.manifest, to automatically request administration rights at launch.
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" />
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
我在Windows Server 2008上尝试过此操作,但清单文件似乎被忽略,并且可执行文件启动时没有足够的权限.
I tried this on Windows Server 2008, but the manifest file seems to be ignored and the executable is launched without sufficient rights.
推荐答案
好,当我使用MT.EXE嵌入清单文件时,它可以工作.仍然不要解释为什么将清单作为单独的文件提供时它不起作用,但是我认为嵌入是一个很好的解决方案.
Ok it works when I embed the manifest file using MT.EXE. Still don't why it doesn't work when I provide the manifest as a separate file, but I guess embeding is a good enough solution.
这篇关于UAC:清单文件被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!