DelphiXE5 X Permission Administrator

4

I need to run a program in Delphi as Administrator, I've already put the manifest file, and it still does not work, it follows my manifest file.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <assemblyIdentity type="win32" name="MyApp" version="1.0.0.0" processorArchitecture="x86"/>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        processorArchitecture="*"/>
    </dependentAssembly>
  </dependency>
  <!-- Windows Vista application security requirements. -->
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
        </requestedPrivileges>
       </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
    <application>
      <!--Windows 7-->
      <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
      <!--Windows Vista-->
      <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
    </application>
  </compatibility>   
</assembly>

I'm trying to run as follows:

  {$R *.res}
  {$R UAC.res}

If I remove this line, and leave only the one from UAC.RES the program works perfectly.

  

{$ R * .res}

Any suggestions?

    
asked by anonymous 18.09.2014 / 16:49

2 answers

5

Your manifest is Ok, apparently. Remember to set the manifest in the application settings?

WhenIdidthisIfollowedthefollowingtutorial(source): link

I hope I have helped. Hugs!

    
19.09.2014 / 15:00
0

Leave only:   {$ R * .res}

You are calling UAC.RES twice, in the "*" and the direct call "{$ R UAC.res}", so it gave the error.

    
14.11.2018 / 12:12