We have an x86 Win32 desktop application. When the installer is run by a Standard (non-Admin) user, we avoid elevating and/or showing a UAC prompt and install under C:\Users\username\AppData\Roaming\...
instead of the common Program Files
directory.
On Windows 10, when our uninstaller is launched from Control Panel -> Programs -> Programs and Features
, no UAC prompt is shown and the uninstaller runs without elevating. This is the desired behaviour. When the same uninstaller is launched from Start -> Settings -> System -> Apps & features
, a UAC prompt is shown.
(The same behaviour can be seen in the Opera browser installer/uninstaller. I tested v35.0.2066.37.)
Why does the same uninstaller behave differently when launched from Apps & features
versus Programs and Features
?
How can the UAC prompt be avoided when the uninstaller is launched from Apps & features?
The manifest of our uninstaller includes this:
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" />
</requestedPrivileges>
</security>
</trustInfo>
I tried changing the requestedExecutionLevel
, and also tried removing trustInfo
completely, but there was no change in behaviour either way.
Tested on Windows 10 version 1511 build 10586.104.
Edit: Just to clarify, the case I'm trying to handle is where the user has a Standard account and does not know the password of an Admin account. If they see a UAC prompt when they try to uninstall, they have no choice but to cancel it, and our uninstaller does not get run.
After the Group Policy Editor opens, navigate to User Configuration > Administrative Template > Start Menu and Taskbar. Click the Standard tab at the bottom of the screen. Then scroll down and double-click on Prevent users from uninstalling applications from Start from the list on the right.
Start > in the search box, type programs and features > press Tnter key > uac prpompt, that's where you either have to click Yes or Continue, or enter the admin password > scroll to find the program you want to uninstall > right click at the program > click Uninstall. Was this reply helpful?
The default, built-in UAC elevation component for standard users is the credential prompt. The alternative to running as a standard user is to run as an administrator in Admin Approval Mode.
User Account Control (UAC) helps prevent malware from damaging a PC and helps organizations deploy a better-managed desktop. With UAC, apps and tasks always run in the security context of a non-administrator account, unless an administrator specifically authorizes administrator-level access to the system.
This is a bug in "Apps & features" as far as I know. The WiX people have closed this issue as a Windows bug and I assume they have notified the correct people @ Microsoft. The behavior is still the same in Insider build 15042 though so it is probably not going to get fixed in time for the Creators Update.
There is no workaround you can use if the standard user cannot elevate.
If they can elevate then you can use the re-spawn workaround posted in the comments or manually load the user profile and call RegOverridePredefKey
but they are both ugly hacks (IMHO).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With