Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delphi 7: Execute application with administrator privileges

How do I add the manifest for UAC without adding XP Themes?

I tried this manifest:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"     version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df"      language="*"/>
     </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="requireAdministrator"
          uiAccess="false"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

but XP themes remains.

I have tried many other manifest, but I get this error:

"Invalid win32 application"

Thanks for the help

like image 597
Giacomo King Patermo Avatar asked Feb 18 '23 18:02

Giacomo King Patermo


1 Answers

If you don't want XP themes, then remove the dependency on version 6 of the common controls. Remove the dependency element, so you have just the trustInfo remaining.

like image 198
Rob Kennedy Avatar answered Apr 26 '23 20:04

Rob Kennedy