Giacomo King Patermo
Giacomo King Patermo

Reputation: 849

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

Upvotes: 4

Views: 1488

Answers (1)

Rob Kennedy
Rob Kennedy

Reputation: 163277

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.

Upvotes: 8

Related Questions