Start the process as a regular user from the ClickOnce application

We have a ClickOnce application that launches an external process using

p = new Process();
p.StartInfo.WorkingDirectory = Path.GetDirectoryName(exe);
p.StartInfo.FileName = Path.GetFileName(exe);
p.StartInfo.Arguments = arguments;
p.Start();

People usually ask if the process can be started as an administration. But in my case it's the other way around:


I would like to make sure that this application is running as the user who is logged in. By default, this happens, for example, when I test it.

But some users (Windows 8.1) report that exe starts with administrator privileges. For some strange reason, Windows automatically wants to run it as an administrator, even if it is not needed at all. If they right-click on exe and check Properties, the box is Run this program as an administratornot checked!

When checking an exe file, the UAC icon is displayed in the folder (example below):

enter image description here

, , , StartInfo?

+4
4

UAC, :

  • ( ), .
  • Windows , , .

, , UAC , - , , , Windows, , evelation.

, , UAC. " " , , " , " "," "" ", , UAC . , (, ).

, - exe ( ), requestExecutionLevel asInvoker. ( .exe.manifest) exe ( clickonce) , . , , , - Google . , , ( ).

+1

, ? # exe UAC Windows 7

:

requestedExecutionLevel level="asInvoker" uiAccess="false"

", DLL , - . UAC "

0

, - : , .

As for some users who receive the “Run as administrator” prompt: it may be that the security rules on the machine somehow identified the executable as untrusted. Try asking your client to check if the "Unblock" button is displayed on the application’s properties page. If so, let them press "Unblock". This will eliminate the UAC invitation in the future.

0
source

All Articles