QT版本:5.5.1 QT Creator
QT Creator 编译出来的程默认是不带管理员权限的。有时是需要管理员权限。
第一步: 创建文件 manifest.xml 添加如下代码
- <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
- <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
- <assemblyIdentity
- version="1.0.0.0"
- processorArchitecture="X86"
- name="mulitray.exe.manifest"
- type="win32"
- />
- <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
- <security>
- <requestedPrivileges>
- <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
- </requestedPrivileges>
- </security>
- </trustInfo>
- </assembly>
第二步: 创建资源文件 adminis.rc
第三步: 在xxx.pro文件中添加
注意事项:
我在开发中在xxx.pro同时添加
这是编译出来的程序,是没有管理员权限的。可以把多个资源写到同一个 .rc文件中。
- 1 24 manifest.xml
- IDI_ICON1 ICON DISCARDABLE "res/LauncherIco.ico"
权限种类: