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. Windows - Is my QT app running as Administrator?
Forum Updated to NodeBB v4.3 + New Features

Windows - Is my QT app running as Administrator?

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.9k 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.
  • F Offline
    F Offline
    Fuzz1985
    wrote on last edited by
    #1

    Hi all,

    Is there a way in QT to tell if my application is running as Administrator? If not, is anybody able to point me in the direction of a Win32 API way of doing it?

    If your interested, the background: Drag and drop does not work when an application is run as administrator, as Windows Explorer is not run with the same level of rights. Usually my app is not run with Administrator rights, except when run at the end of the installer (as it runs as a child process and the installer needs Administrator rights). In this one instance, my massive graphic of "Drop your files here" seems silly!

    Thanks,
    Damien

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Interesting question in itself. I don't think Qt has API that will help you here. However, why not fix the other end of the issue first? I mean: does your installer really have to run your application for admin rights? It seems to me, that your installer should be able to run your application as the user that is logged in, instead of with elevated rights. That would solve your issue as well, and sounds like the better solution to me.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fuzz1985
        wrote on last edited by
        #3

        Hi Andre,

        Thanks for your reply. However, unfortunately I don't have that control over the installer (basically I create an installer in NSIS, then a third party wraps it in their own installer). Hence me hoping there was another way!

        If it can't be acheived within my code, I think my only other option would be for me to get the installer to not offer the option to "Run Now". This way the user must manually run the application so drag and drop will work. Far from ideal, however better than some features not working!

        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 Extensions
        • Unsolved