Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Make 64bits Qt app run as admin on windows

Make 64bits Qt app run as admin on windows

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 744 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • thamT Offline
    thamT Offline
    tham
    wrote on last edited by
    #1

    I try following manifest

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
      <assemblyIdentity version="2.0.2.0" processorArchitecture="amd64" type="win32"/>
      <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
        <security>
          <requestedPrivileges>
            <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
          </requestedPrivileges>
        </security>
      </trustInfo>
    </assembly>
    

    Run mt

    QMAKE_POST_LINK += mt -nologo -manifest $$PWD/some_app.manifest -outputresource:$$OUT_PWD/release/$$TARGET".exe" $$escape_expand(\n\t)

    but I got following error

    Activation context generation failed for "C:\Users\yyyy\programs\Qt\build-eyedius-client-Desktop_Qt_5_9_4_MSVC2017_64bit-Release\release\some_app.exe".Error in manifest or policy file "C:\Users\yyyy\programs\Qt\build-eyedius-client-Desktop_Qt_5_9_4_MSVC2017_64bit-Release\release\some_app.exe" on line 2. The required attribute name is missing from element assemblyIdentity.
    

    Have tried ia64, but did not work either. How could I create a correct manifest for this?Thanks

    1 Reply Last reply
    0
    • thamT Offline
      thamT Offline
      tham
      wrote on last edited by
      #2

      @tham said in Make 64bits Qt app run as admin on windows:

      assemblyIdentity version="2.0.2.0" processorArchitecture

      Solved, check this page and write the necessary manifest

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
        <assemblyIdentity version="34789" name="some app." type="win32"/>
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
          <security>
            <requestedPrivileges>
              <requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
            </requestedPrivileges>
          </security>
        </trustInfo>  
      </assembly>
      
      1 Reply Last reply
      2

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved