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. How to set my app running as administrator?

How to set my app running as administrator?

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 5.1k Views 2 Watching
  • 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.
  • EngelardE Offline
    EngelardE Offline
    Engelard
    wrote on last edited by Engelard
    #1

    Why the hell such common stuff is so complicated? Spent couple hours in google/youtube and still can't perceive such a goal. Tried to do as in video guide, as far i understand something wrong in .pro file, since it can't assign .rc file:

    0_1543504277757_fuckingtrashsdsdfdfg.jpg

    In my project directory both files are set and seems to be correct:

    od.rc file:

    #include <Windows.h>
    
    ID_ICON    ICON    DISCARDABLE    "Qt.ico"
    CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "od.exe.manifest"
    

    od.exe.manifest file:

    <?xml version=”1.0" encoding=”UTF-8" standalone=”yes”?>
    <assembly xmlns=”urn:schemas-microsoft-com:asm.v1" manifestVersion=”1.0">
     <assemblyIdentity version=”2.0.0.0" processorArchitecture=”X86" name=”OD.exe” type=”win32"></assemblyIdentity>
     <description>my Description</description>
     <!-- Identify the application security requirements. -->
     <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2">
     <security>
     <requestedPrivileges>
     <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”>
     </requestedPrivileges>
     </security>
     </trustInfo>
    </assembly>
    

    I just don't understand, why such common stuff is such hell in the ass.

    JonBJ 1 Reply Last reply
    -1
    • EngelardE Engelard

      Why the hell such common stuff is so complicated? Spent couple hours in google/youtube and still can't perceive such a goal. Tried to do as in video guide, as far i understand something wrong in .pro file, since it can't assign .rc file:

      0_1543504277757_fuckingtrashsdsdfdfg.jpg

      In my project directory both files are set and seems to be correct:

      od.rc file:

      #include <Windows.h>
      
      ID_ICON    ICON    DISCARDABLE    "Qt.ico"
      CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "od.exe.manifest"
      

      od.exe.manifest file:

      <?xml version=”1.0" encoding=”UTF-8" standalone=”yes”?>
      <assembly xmlns=”urn:schemas-microsoft-com:asm.v1" manifestVersion=”1.0">
       <assemblyIdentity version=”2.0.0.0" processorArchitecture=”X86" name=”OD.exe” type=”win32"></assemblyIdentity>
       <description>my Description</description>
       <!-- Identify the application security requirements. -->
       <trustInfo xmlns=”urn:schemas-microsoft-com:asm.v2">
       <security>
       <requestedPrivileges>
       <requestedExecutionLevel level=”requireAdministrator” uiAccess=”false”>
       </requestedPrivileges>
       </security>
       </trustInfo>
      </assembly>
      

      I just don't understand, why such common stuff is such hell in the ass.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Engelard
      I don't know the answer to your error (other than guessing you're including a/the manifest more than once), but when VS/MSVC reports those error "numbers" like CVT1100 did you Google for that, because there are loads of hits? (And don't worry about the second one till you've dealt with the first, because they are likely related.)

      EngelardE 1 Reply Last reply
      0
      • JonBJ JonB

        @Engelard
        I don't know the answer to your error (other than guessing you're including a/the manifest more than once), but when VS/MSVC reports those error "numbers" like CVT1100 did you Google for that, because there are loads of hits? (And don't worry about the second one till you've dealt with the first, because they are likely related.)

        EngelardE Offline
        EngelardE Offline
        Engelard
        wrote on last edited by
        #3

        @JonB said in How to set my app running as administrator?:

        CVT1100 did you Google for that, because there are loads of hits?

        Already did, and seems like found the solution, but thats totally different subject.

        1 Reply Last reply
        0
        • Chris KawaC Offline
          Chris KawaC Offline
          Chris Kawa
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Unless you need it for other things you don't need to add the manifest manually. You can require admin privileges via linker flag:

          QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"
          
          EngelardE 1 Reply Last reply
          6
          • Chris KawaC Chris Kawa

            Unless you need it for other things you don't need to add the manifest manually. You can require admin privileges via linker flag:

            QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"
            
            EngelardE Offline
            EngelardE Offline
            Engelard
            wrote on last edited by
            #5

            @Chris-Kawa said in How to set my app running as administrator?:

            QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"

            Damn i know it somehow possible to do that short and easy way. Why no such stuff in google, only through creation those two files and all...

            JonBJ 1 Reply Last reply
            0
            • EngelardE Engelard

              @Chris-Kawa said in How to set my app running as administrator?:

              QMAKE_LFLAGS_WINDOWS += /MANIFESTUAC:"level='requireAdministrator'"

              Damn i know it somehow possible to do that short and easy way. Why no such stuff in google, only through creation those two files and all...

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by
              #6

              @Engelard
              https://www.qtcentre.org/threads/29107-win32-how-to-modify-the-manifest-with-qmake?p=137399#post137399

              https://stackoverflow.com/a/40272925/489865

              :)

              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