There is an application on Qt, and is usually located in Program Files. In some cases, when the program is launched, it requests / does not request administrator rights. What you need to add to run always with admin rights.

    1 answer 1

    For the program to request administrator rights in Windows, you need to embed the manifest file in it. The file is embedded in the finished executable file by the mt program. It is usually installed with Visual Studio. If you do not use Visual Studio, then you will have to install this program separately, read the relevant documentation. The manifest file might look like this:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="applicationname" type="win32"></assemblyIdentity> <description>Description of application</description> <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2"> <security> <requestedPrivileges> <requestedExecutionLevel level="requireAdministrator"> </requestedExecutionLevel> </requestedPrivileges> </security> </trustInfo> </assembly> 

    Save this file as manifest.xml next to your executable file. After that, run the command line:

     mt -manifest manifest.xml -outputresource:your_program.exe 

    In order for the manifest to be automatically embedded into the file when building the project in Qt Creator, you need to add a post-link script to the pro-file:

     win32 { QMAKE_POST_LINK += mt -manifest $$PWD/manifest.xml -outputresource:$$OUT_PWD/$$TARGET".exe" $$escape_expand(\n\t) }