Click here to Skip to main content
16,017,235 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a setup project in c# visual studio 2008 .
In this project am doing reading and writing files where application exists.
If i install setup in windows 7 it is having permission problem.How to give administrative permission while creating project.
Posted

Try Running the Application using "Run As Administrator" option
 
Share this answer
 
Comments
kalaivanan from Bangalore, India 17-Oct-13 8:42am    
Thanks for reply
If am running as administrator it is working.But user double click on short cut of project it has to ask Run as administrator?. because i cannot ask user to run as administrator.
Hi ,

u just add one application manifest file in your project . and change the credential to the administrator . like this

XML
<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" />

            Specifying requestedExecutionLevel node will disable file and registry virtualization.
            If you want to utilize File and Registry Virtualization for backward
            compatibility then delete the requestedExecutionLevel node.
        -->


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

      </requestedprivileges>
    </security>

thanks
Animesh
 
Share this answer
 

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