Click here to Skip to main content
15,889,865 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi friends,

I have done a C# Windows Application in VS 2012...
I recently added a manifest file to give Administrative privileges to my application.
Later, I removed that... But At the client side, It still asks this Question when user opens my program...
"Do you want to allow the following program from an unknown publisher to make changes to this computer?"

Please How to avoid it :(
Posted

You need to have app.manifest file in your project and set correct executionLevel as follows:

XML
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
    <security>
      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
        <!-- UAC Manifest Options
            If you want to change the Windows User Account Control level replace the
            requestedExecutionLevel node with one of the following.

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

        <!-- Use following execulation level to bypass the UAC prompt-->
        <requestedExecutionLevel level="asInvoker" uiAccess="false" />
      </requestedPrivileges>
    </security>
  </trustInfo>
 
Share this answer
 
The client needs to use Windows Explorer to access the properties of the executable, and Unblock it.
 
Share this answer
 
You can't. If your app is trying to do something that requires elevated privileges, then it must run in an elevated state. When you try that, Windows confirms with the user. Otherwise, there would be no point in having access restrictions in the first place...

Check your application - can you do the job in some other way that doesn't require an elevation?
 
Share this answer
 
Comments
Yesudasan Moses 5-Aug-13 5:37am    
Not really, I initially was accessing the registry... but now,, I removed it from the application.. and it doesnt require admin privileges....
In my developing machine, It works perfectly..,, Only at the client machine it happens...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900