Hallo Everybody,
i have a question: is there a possibility to run only my plugin and not the whole tc under user rights elevation as my plugin requires it under Win 7/Vista.
Thank's a lot in advance
Regards
Alexander
Support vor UAC/ Rights Elevation for
Moderators: Hacker, petermad, Stefan2, white
- apowolozki
- Junior Member
- Posts: 7
- Joined: 2010-07-06, 10:05 UTC
- Location: Dortmund, Germany
- Matthias030
- Senior Member
- Posts: 423
- Joined: 2007-03-04, 10:48 UTC
- Location: Berlin
I think it's not possible to elevate only TC internal wlx,wcx,wdx,wfx plugins without elevating TC.
Here is a small tool to elevate single programs: http://www.totalcmd.net/plugring/Sudo.html
You can use it to elevate programs in TC button bar. Maybe it helps
Here is a small tool to elevate single programs: http://www.totalcmd.net/plugring/Sudo.html
You can use it to elevate programs in TC button bar. Maybe it helps
Unfortunately you can't elevate just DLLs. But if you want to do it right way, you should create a service (application w/o any windows that may work in background) that will be started in elevated mode and communicate with your plugin through e.g. pipe. So, service will have access to system functions that require admin rights and will perform needed operations or retrieve needed information to pass to plugin.
- apowolozki
- Junior Member
- Posts: 7
- Joined: 2010-07-06, 10:05 UTC
- Location: Dortmund, Germany
And how should the service be hosted? If without use of com it could be an alternative for me.MVV wrote:Unfortunately you can't elevate just DLLs. But if you want to do it right way, you should create a service (application w/o any windows that may work in background) that will be started in elevated mode and communicate with your plugin through e.g. pipe. So, service will have access to system functions that require admin rights and will perform needed operations or retrieve needed information to pass to plugin.
Dou you may be have an small demo code or know where i could find one?
thank's a lot
Alexander
No COM, just normal application that may be started with system or by first request (your plugin may detect if service is not started yet e.g. using mutex that service will register and start service with elevated rights using ShellExecute with verb "runas") and remain in memory (maybe some option/parameter to close it when not needed). Then you will need some data exchange protocol (what you need to send to service and what service will return) that will be used during communication via pipe. And read about pipes - how to create pipe between applications.
BTW TCMADMIN uses similar approach - it is started with elevated rights and does what TC tells to do. As I see, TC passes its PID as command line parameter - maybe this allows TCMADMIN to detect application to connect to.
BTW TCMADMIN uses similar approach - it is started with elevated rights and does what TC tells to do. As I see, TC passes its PID as command line parameter - maybe this allows TCMADMIN to detect application to connect to.