2

Applications must be run with administrator privileges. How to ask the user is? How to verify that he agreed to? How do I know whether already running application as an administrator?

Made as described here by the user ChrisW67. The result is not received. If possible, give an example of "Hello world" project.

P.S Windows 7. Am writing in Qt Creator. Qt5.2

tioo
  • 99
  • 1
  • 6
  • 1
    possible duplicate of [Using QT Creator how can I set the execution level as requireAdministrator](http://stackoverflow.com/questions/5686977/using-qt-creator-how-can-i-set-the-execution-level-as-requireadministrator) – Harry Johnston May 08 '14 at 21:41
  • possible duplicate of https://stackoverflow.com/questions/6418791/requesting-administrator-privileges-at-run-time – AnotherParker Sep 17 '15 at 18:12

1 Answers1

1

Why does your application require admin rights? A modern application should in most cases be able to avoid this. You can set up the launching shortcut to require admin rights. The user will then be prompted on launch. "Run this program as an Administrator".

enter image description here

Stein Åsmul
  • 34,628
  • 23
  • 78
  • 140
  • I cannot adjust shortcut on launch. Because applications can not be run through the shortcut. Applications are very specific and cross-platform. On Linux, I can install a s bit (chown root a.out; chmod +s a.out) How can I do it on windows? – tioo May 08 '14 at 18:35
  • Is this a small binary doing something simple with a log file output? If you launch such a tool directly from the users "My Documents" folder you should be able to write an output file there. – Stein Åsmul May 08 '14 at 23:54