Reputation: 1572
I have a small app, that needs to change some stuff in the registry and open on startup and for that, I need to open the application as administrator.
I do not want the user to be asked every time if the app needs admin rights.
I tried adding a manifest file and including this line:
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
also, the application should work on stations that its users are not an administrator
is there any way to do such a thing? thank you for your help
Upvotes: 0
Views: 138
Reputation: 570
It sure sounds like you are trying to ask for a way to bypass the security token on a key. That is simply not possible.
If the user is not an administrator, then nothing is going to let them edit a key protected by an ACL that only allows administrators to change it. If that was possible, then the entire security system is completely broken.
If your app REQUIRES admin rights, which is what you are requesting in the manifest, then you will be prompted every time it is started. There is no work around for this short of disabling UAC altogether (if there was, apps would simply always bypass UAC and make it useless).
If you REALLY need to do this, the way I would do it is with a custom action in your installer that modifies the ACL protecting the key in question to allow users to modify it. Then you wouldn't need your main application to have admin rights in the first place.
Upvotes: 1