0

I created desktop app for Windows (running mostly on Win 10) using QT libraries. Explicitly in my code, I don't perform any operations that require administrator rights, especially writing to "Program Files" etc - application uses local app data folder structure (I double checked this going deeper and deepr into this matter).

In my manifest file application also doesn't need admin privileges (it's as invoker).

However, my application still requires admin rights to run. My question is not about how to solve my specific case, because I established that it's because deep dependencies hidden in QT libs to Windows API and these calls often require admin rights in case of operations that seem to not exactly need it like drag & drop or network connection with specific IP address.

I followed it using Microsoft Standard User Analyzer (SUA) tool on my executable.

I'm putting here example log from SUA investigation: enter image description here

In detailed info for pos. 1-2 I can see it's because:

enter image description here

However for 3rd position, it is even more complex problem related to PROCESS_QUERY_INFORMATION access allowed only by elevated processes. Example stack trace (one of many many more):

enter image description here

Summarizing - my question:

You can believe me that I don't perform any operations that require admin rights from "normal", common sense point of view. Moreover my customer have old application written in .NET env that doesn't need admin rights and does the same things in general (I mean nothing "special").

What is a general way to overcome such problems with QT development environment? Or using QT everyone takes a risk that the application mostly will require admin rights?

Antares
  • 518
  • 6
  • 11
  • I don't think this is caused by Qt. What's is your Qt version? I develop application using Qt 5.12 and 6.2. Both does not require admin rights and my app runs fine without having to be elevated (and it does not ask to). – Alexander Dyagilev Apr 04 '22 at 21:23
  • @AlexanderDyagilev thanks for your input! Could you provide me examples of operations/features your apps have ? I try to find out which features possibly are problematic and could need elevation. However if issue would be totally beyond QT so it is even more complicated. – Antares Apr 05 '22 at 10:30
  • My Qt version used to build my application is 5.15.2 – Antares Apr 05 '22 at 10:38
  • 1
    An example: https://www.freedownloadmanager.org :). It does not require admin rights. E.g. you can install and use it under a limited account. – Alexander Dyagilev Apr 05 '22 at 11:41
  • @AlexanderDyagilev thanks. Seems much more complex than mine. If you are looking at stack traces that I put in my question, can you see there possible reasons for elevation i my case - you as experienced developer? Any idea maybe?:) – Antares Apr 05 '22 at 13:21
  • Sorry, I can't say. Try a new system. Maybe the current one is just infected by a virus or something... – Alexander Dyagilev Apr 05 '22 at 14:31
  • 2
    UAC can be triggered by a number of things besides actually performing privileged actions. Does your executable name or meta information contain the words "setup" or "installer" or something similar? Does your manifest contain requestedExecutionLevel? See this answer as a starting point: https://stackoverflow.com/a/4133552/1886519 – kqt Apr 05 '22 at 15:10

0 Answers0