Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Administrator rights for apps built with MinGW
Qt 6.12 LTS is out! See what's new in the release blog

Administrator rights for apps built with MinGW

Scheduled Pinned Locked Moved General and Desktop
8 Posts 2 Posters 4.3k Views 1 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Hi everyone
    For a long time I've been using the following code in my pro file to give Admin rights to my apps using MSVC2010
    @
    CONFIG += embed_manifest_exe
    QMAKE_LFLAGS_WINDOWS += $$quote( /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" )
    @

    But it seems it is not working with MinGW. Any ideas???

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      See the second answer to "this question":http://stackoverflow.com/questions/5744008/is-it-possible-to-run-as-administrator-only-through-code.

      (Z(:^

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        You mean the solution is ShellExecute or CreateProcess. In other words, another app calling my app using runas?!
        Thanks, this may work but it does not seem to be the solution in my case.
        I need my app to become admin privileged.

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          OK, then there is a trick to do that, but it will work only on Vista+. You need to change the name of your exe so that it contains "setup" somewhere in the file name. That usually (always?) triggers the UAC.

          (Z(:^

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #5

            Or, of course, create a small "launcher" app, that will use runas to launch your real application.

            (Z(:^

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #6

              [quote author="sierdzio" date="1403250206"]OK, then there is a trick to do that, but it will work only on Vista+. You need to change the name of your exe so that it contains "setup" somewhere in the file name. That usually (always?) triggers the UAC.[/quote]

              [quote author="sierdzio" date="1403250251"]Or, of course, create a small "launcher" app, that will use runas to launch your real application.[/quote]

              Yeah right. These are all solutions. (I wasn't aware of the one you mentioned about Vista+) and thanks again.

              But let me ask my question this way:
              How can I embed app manifest into my Qt app while using MinGW compiler?

              1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #7

                I know you want that, but you yourself claim it does not work ;-) So I'm tryign to provide an alternative.

                According to "this":http://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/ article, manifests should work.

                (Z(:^

                1 Reply Last reply
                0
                • ? Offline
                  ? Offline
                  A Former User
                  wrote on last edited by
                  #8

                  :D Thanks for the alternatives.

                  [quote author="sierdzio" date="1403250989"]
                  According to "this":http://www.transmissionzero.co.uk/computing/win32-apps-with-mingw/ article, manifests should work.[/quote]

                  Need to check this. Looks like a solution! Not an alternative ;) I'll share the results.

                  1 Reply Last reply
                  0

                  • Login

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