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?
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 (eg those containing setup , install , update in their filenames) and will try to elevate them automatically. Microsoft does this as a compatibility hack:
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>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.