3
I have put a method in my system to change the registry by making it launch together with windows, for this it is necessary that the executable runs in administrator mode. The problem is that every time the system starts, the application opens and shows the message asking if the user wants to start as administrator, which seems to me something boring.
The question I ask is: Is there a way to open the application in administrator mode only the first time? or maybe check if there is registry in windows and if yes run in normal mode?
http://chapmanworld.com/2015/06/08/elevated-privileges-for-delphi-applications/
– Pablo Tondolo de Vargas
That kind of change isn’t usually seen very well. I suggest you check on your system if the application was opened as an administrator, and if it was not, display a message warning the user that a particular function will not be executed because of the privileges, and request that next time you run the application as an administrator.
– Victor Tadashi
That’s what I did, Victor. I don’t think you can do it any other way.
– Douglas Carvalho
You can make the application try to re-run with the administrator profile, and if the user accepts, close the "non-administrative' version. Once the application is configured as you want, simply do not call this upgrade function. It is an elegant solution as it will only "bother" the user with the UAC until it accepts (and in the case of a refusal, may offer an option not to insist, or to remember again in N days)
– Bacco
And in that case, you do not put the option in the manifest. You have to run in Runtime.
– Bacco