.net & admin rights - how to insert a manifest file for two different scripts

I have one .net application that will be installed in the โ€œprogram filesโ€ working in two different modes:

  • "ADVANCED_MODE" with all plugins that must display the UAC to run as administrator
  • "BASIC_MODE" with several plugins which should work as usual by the user

What to do to solve this case?

If I insert a manifest file ( requireAdmininstalled), it will not work for BASIC_MODE. If I do not use manifests, then I have no way to pop up in UAC in ADVANCED_MODE. If I use " asInvoker" or " highestAvailable", I get strange effects when starting the application from Program Files as a normal user account: it closes immediately after launch without any failure.

What would you do? What are my options?

0
source share
1 answer

Use asInvoker in the manifest and when your application is running in ADVANCED_MODE (and you are not yet an administrator), start a new instance of your application using ShellExecute and the runas verb.

" " , - ( , ). Microsoft, LUA Buglight Process Monitor, ...

+3

All Articles