程序文件文件夹中的应用程序上的Shield图标 [英] Shield icon on app in Program Files folder
问题描述
我正在构建不需要管理员特权的应用程序,因此我将清单添加为.rc文件的一部分:
I'm building an application that doesn't need administrator privileges so I'm adding a manifest to it as part of my .rc file:
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST MOVEABLE PURE
{
``<?xml version ='1.0'encoding ='UTF-8'standalone ='yes'? :schemas-microsoft-com:asm.v1'manifestVersion ='1.0'> type ='win32'/>
< description> MyApp</description>
< trustInfo xmlns ='urn:schemas-microsoft-com:asm.v2'>
< requestedPrivileges>
< requestedExecutionLevel level ='asInvoker'uiAccess ='false'/>
</assembly>"
}
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST MOVEABLE PURE
{
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
<assemblyIdentity
name='MyApp'
version='2.3.1.7728'
processorArchitecture='x86' type='win32'/>
<description>MyApp</description>
<trustInfo xmlns='urn:schemas-microsoft-com:asm.v2'>
<security>
<requestedPrivileges>
<requestedExecutionLevel level='asInvoker' uiAccess='false'/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>"
}
构建完成后,应用程序的图标在其int构建的文件夹中正确地没有
UAC防护.然而,当它安装到:
when the build is done, the application's icon correctly doesn't have the
UAC shield on it in the folder it's built int. Yet when it's installed into:
C:\ Program Files \ MyApp \ MyApp.exe
C:\Program Files\MyApp\MyApp.exe
它有一个盾牌.为什么?即使我将exe从其内置文件夹复制到其安装位置,它也会得到保护.
it has a shield. Why? Even if I recopy the exe from the folder it's built in to its install location, it gets the shield.
仅供参考:我的开发环境是Cygwin下的gcc.我通过使用"mt"检查清单是否为exe的一部分.提取它.
FYI: My development environment is gcc under Cygwin. I checked that the manifest is part of the exe by using "mt" to extract it.
推荐答案
在测试期间,我取出清单并将其安装在另一台运行全新安装Vista.在那台计算机上,没有显示盾牌图标-但是启动该应用程序仍然向我提出了UAC高程授权请求.
During my testing, I took the manifest back out and installed the application on another computer running a fresh install of Vista. On that computer, the shield icon didn't appear -- yet launching the application still presented me with the UAC elevation authorization request.
为什么屏蔽图标不会显示在另一台计算机上?
Why would the shield icon NOT display on the other computer?
这篇关于程序文件文件夹中的应用程序上的Shield图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!