How to elevate UAC for the application?

  • Thread starter Thread starter YXQ
  • Start date Start date
Y

YXQ

In Vista, startup an application that need to elevate UAC power, there are
two kinds dialog box:
1. this application need to permission to contine.
2. Unknow application to access your computer.

I know how to do for the second way, embed the xml code below, but how to
do for the first way? thank you

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>YourAppName Application</description>

<!-- Identify the application security requirements. -->
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
 
YXQ said:
In Vista, startup an application that need to elevate UAC power, there are
two kinds dialog box:
1. this application need to permission to contine.
2. Unknow application to access your computer.

I know how to do for the second way, embed the xml code below, but how to
do for the first way?

Short answer - you need to Digitally Sign your code.

More fully:
(taken from: http://technet.microsoft.com/en-gb/magazine/cc138019.aspx)

(Search for "Figure 11"; it's just below there)
If an image is a Windows component digitally signed by Microsoft
and the image is in the Windows system directory, then the dialog
displays a blue stripe across the top as shown at the top of Figure
11. ...

.... that's the "Windows" flavour of UAC dialog ...
... The gray stripe (middle dialog) is for images that are
digitally signed by someone other than Microsoft, ...

.... that's the "A program needs ..." version ...
... and the orange stripe (bottom dialog) is for unsigned images.

.... and that's the big, nasty, yellow-y, orange-y "An unidentified
program ..." flavour, that you're getting at the moment.


Time to go out and sign yourself up for a Digital Certificate, if you
don't have one already, and start signing your applications.

HTH,
Phill W.
 
Back
Top