UAC prompt while installing from internet explorer

970 views Asked by At

Hi have created an installer which installs the application at user level. When i extract setup.exe from the cab file and run locally it does not prompt me for UAC and installs normally and installs in user context.

The application and cab are digitally signed.

But when i install the same using one click installer it prompts me for UAC and installs it in admin context.

Can any throw some light why same setup.exe behaving differently?

What can i do to avoid this?

I want my application to be installed at user level without admin access?

1

There are 1 answers

0
Ian Boyd On

My guess is that setup.exe is triggering the UAC setup compatibility heuristic. From MSDN:

User Account Control: Detect application installations and prompt for elevation

When an application installation package is detected that requires elevation of privilege, the user is prompted to enter an administrative user name and password. If the user enters valid credentials, the operation continues with the applicable privilege.

Windows tries to detect certain applications that are installers (e.g. those containing setup, install, update in their filenames) and will try to elevate them automatically. Microsoft does this as a compatibility hack:

  • most users won't realize they are supposed to Right-click a setup application and select Run as Administrator
  • even fewer developers correctly mark their installer as requireAdministrator
  • even fewer developers use MSI, which knows how/when/if to elevate to an administrator

You can inform Windows that your application should not be run as an administrator. You do this by adding the asInvoker option to your executable's assembly manifest:

<?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="client"
            type="win32"
    /> 

    <description>CodeJunkie Widget Installer</description> 

    <!-- Disable Setup elevation compatibility heuristics since we're named setup.exe -->
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
        <security>
            <requestedPrivileges>
                <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
            </requestedPrivileges>
        </security>
    </trustInfo>
</assembly>