【发布时间】:2009-09-18 12:35:46
【问题描述】:
我的一个可执行文件将一些配置写入到 C:\Program Files\MyApp\config.xml 的 XML 文件中。它需要在 Vista / Server 2008 上以管理员身份运行,否则操作系统不会让它写入该位置。
我包含了一个名为 config.exe.manifest 的清单文件,用于在启动时自动请求管理权限。
这是我的清单文件:
<?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 上尝试过此操作,但清单文件似乎被忽略,可执行文件在没有足够权限的情况下启动。
【问题讨论】:
标签: windows-server-2008 uac windows-vista manifest