0
votes

I'm developing an application in C++ which needs to be as portable as possible and be able to run without elevated privileges, so a regular user can run it. But I'm not sure how can I check it because in my system it runs without any popup like UAC or asking for privileges. Is there a way to check required privileges by an application?

2

2 Answers

2
votes

There are two ways how an application can cause windows to display the UAC prompt to aquire higher privileges:

Heuristic

Windows includes a heuristic-based detection mechanism that tries to detect whether your application should be classified as an "installer" and should thus require elevated privileges. This is done automatically and can cause problems if it has a false-alarm and this causes your program to require elevated privileges.

Explicit

If you do not want to rely on the automatic detection system to correctly classify your application, you can explicitely state what elevation level your application needs by modifiying your application's manifest.

Quoting this MSDN article:

asInvoker requesting no additional permissions. This level requires no additional trust prompts.

This is what you should use in your case if you want to guarantuee that your application will not be categorized wrongly.

0
votes

If you will not mark it explicitly in app manifest it should not require elevated privileges, however you need to ensure all functionalities would work.