Search code examples
c#windowsuacprivileges

How force C# application NOT run as adminsitrator?


I'm writing an updater for an application, and my problem is that it always show the UAC prompt when I run it.

The application itself doesn't require administrator rights, it downloads a .zip file only from the internet and then extract it to a custom location set by user during the installation.

I tried to add the following values to my app.mainfest, but none of them seems to work and the UAC prompt is still shown:

<requestedExecutionLevel  level="asInvoker" uiAccess="false" />

and

<requestedExecutionLevel  level="highestAvailable" uiAccess="false" />

How can I force a C# application to run without administrator rights?


Solution

  • What is your updater application file name? Admin right is required when the file name contains or equal setup, update, patch, install or something like that. You can try changing your updater application file name to example.exe and see if that works.

    For more information you can read the Installer Detection Technology documentation.