Delphixe5 X Permission Administrator

Asked

Viewed 699 times

4

I need to run a program in Delphi as Administrator, I already put the manifest file, and even then it does not work, follow 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 this way:

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

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

{$R *.res}

Any suggestions ?

2 answers

5


  • Thanks @Rafael_lima, solved!

0

Just leave it: {$R *.res}

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.