Mechanism of Windows UAC Shield/Buckler appendage on .exe files
I have written a simple program.
Recently I found that when giving it a name including update
as its substring (case insensitive), the file automatically gets a Windows shield/buckler on it in Windows Explorer.
In the following image, all files are identical except for different file names:
I was wondering if this is because there is a UAC Shield/Buckler Appendage Mechanism
in Windows Explorer and its backend parts.
Any suggestions and clues are appreciated.
Solution 1:
Adding a manifest file is the solution.
Due to the Installer Detection Technology of UAC, a UAC shield icon will be displayed on your 32-bit executable file with no requestedExecutionLevel
in the manifest, but with keywords like “install”, “setup”, “update” etc in the filename. With the UAC shield icon, if we launch the executable file, the UAC elevation dialog will pop up.
Source
The manifest should contain a requestedExecutionLevel
. Here is an example of a partial manifest file:
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
See here for more info.