开发者

Executable not requesting elevated when part of deployment project

开发者 https://www.devze.com 2023-04-04 09:26 出处:网络
I\'ve created an executable that\'s called by another app for processes that require UAC elevated privileges. If I build this project with the below manifest it requests UAC fine, if I add this projec

I've created an executable that's called by another app for processes that require UAC elevated privileges. If I build this project with the below manifest it requests UAC fine, if I add this projects output to my setup project it creates it without UAC?

<?xml version="1.0" encoding="UTF-8" standalone="yes"开发者_JAVA百科?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
   <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="CreateApp" type="win32"/>
   <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel level="requireAdministrator"/>
      </requestedPrivileges>
    </security>
  </trustInfo>
</assembly>

Any idea why this is or if it's possible to have it as part of the setup project with the manifest?


Custom actions in InstallExecuteSequence already run as child processes of Windows Installer service. So they inherit their privileges and the manifest is not used.

To run a custom action with full privileges you should schedule it as deferred with no impersonation.

If you are not using the EXE as a custom action and you are just launching it from another process, make sure you use ShellExecute.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号