Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Services2 - File-system plugin to list and manage services
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Thu Apr 10, 2014 9:52 am    Post subject: Services2 - File-system plugin to list and manage services Reply with quote

Hi there Smile

I've written my first file-system plugin and just published it on totalcmd.net.

At the moment it is still in alpha state. Though it is quite stable there are some features missing like service management on remote computers (that's why it's not beta yet).

What is Services2?

  • It's a file-system plugin that can list, control and manage services registered in the system. It runs on Windows 2000 and later, both 32 and 64 bit systems.
  • It is an alternative to the existing Services plugin (Version 2.4) written by Serge Kandakov (KaSA).

What are the adavantages over Services 2.4?

  • Unicode capable (this should be implemented correctly).
  • 64 Bit version of this plugin to use in Total Commander x64.
  • Translation to other languages possible (Chinese, Danish, German, Hungarian, Italian and Russian are included in the package).
  • Support for custom columns, including default view.
  • Additional startup type "Automatic (Delayed)" on Vista and higher.
  • and many more (see totalcmd.net for an almost complete list)

Some more screenshots:
Service properties - General
Service properties - Advanced
Service properties - Dependencies
Custom columns
Plugin settings
"File" download (F3 on a service)

Please feel free to test it, comment, discuss, report bugs and so on Very Happy.



If you want to make a translation of this plugin to your own language:

  1. Make a copy of "English.lng" to "<your_language>.lng". Be sure to use the language's English name for the file name!
  2. Open "<your_language>.lng" in your favorite editor. The .lng files should be encoded in Unicode (UTF-16), so please make sure to use an editor with Unicode capability.
  3. Translate all strings. Please ensure you don't have duplicate keyboard shortcuts for labels, buttons etc. within the same dialog.
  4. Add the language's name in the native language to section [Language].
    (optional) Add your name, nick and/or the date of the translation to section [Language].
  5. Repeat steps 2 and 3 with pluginst.inf and Services2.lng (custom columns). Note: These two files should be encoded in ANSI.
  6. Send the new language files to the e-mail address mentioned in readme.txt, or post a link to the file in this thread.


Regards
Dalai


Last edited by Dalai on Wed Aug 13, 2014 2:14 pm; edited 3 times in total
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5819
Location: Russian Federation

PostPosted: Thu Apr 10, 2014 10:01 am    Post subject: Reply with quote

I think elevation support is a must-have for such plugin: if TC has no admin rights (or it is not elevated), plugin should start elevated admin tool that sets service parameters...
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Thu Apr 10, 2014 10:22 am    Post subject: Reply with quote

Yes, in general you're right. But how am I supposed to do that? TC's command line parameters only allow to enter plugins (not to control them) and I don't know the command line parameters for TC's admin tool... and I don't think it's possible with it. If you know a (simple) way, let me know.

Ah, now I get it: I should write my own admin tool for such tasks, right? I will think about that.

Regards
Dalai
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5819
Location: Russian Federation

PostPosted: Thu Apr 10, 2014 10:33 am    Post subject: Reply with quote

Yes, you should write your own admin tool that will connect pipe opened in TC process by your plugin, and then it will accept and execute commands that your plugin sends to it.
It requires some work of course but it worths it.

Elevated process may be started using ShellExecute with verb "runas". Admin tool may stay active until pipe is opened so it will close with TC, or after some inactivity time.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Sir_SiLvA
Power Member
Power Member


Joined: 06 May 2003
Posts: 2754

PostPosted: Fri Apr 11, 2014 7:32 am    Post subject: Reply with quote

MVV wrote:
I think elevation support is a must-have for such plugin: if TC has no admin rights (or it is not elevated), plugin should start elevated admin tool that sets service parameters...

NO, NO and NO Exclamation

If TC is NOT startet as Admin, a plugin should NEVER be able to elevate itself Exclamation
(and I seriously hope Chris prevents that in the name of security....)

@Dalai: thanks for the work Exclamation havent tried it yet, but why is it called Services2 when it actually has to be called Services3 Question

Service-Plugin 1 was written by
Code:

      CompanyName: None
      FileDescription   : Services
      FileVersion   : 2, 4, 0, 214
      InternalName   : Services
      LegalCopyright   : Copyright © 2002-2004 by Serge Kandakov
      OriginalFilename   : Services.wfx
      ProductName   : Services plugin for Total Commander


Service-Plugin 2 was written by
Code:

      CompanyName: Jerry home
      FileDescription   : Service plugin for Total Commander
      FileVersion   : 1.0.0.0
      InternalName   : TC Services.wfx
      LegalCopyright   : Copyright (C) 2003-2005 by Jerry
      OriginalFilename: TC Services.wfx
      PrivateBuild   : 1.0.0.0
      ProductName   : TC Services
      ProductVersion   : 1.0.0.0


Edit: at first look - why provide an example ini making one think you store data in same directory as plugin is (what i prefer over anything else) when the Plugin itself shows %commder_path%\fsplugin.ini as storage place of ini settings?
Back to top
View user's profile Send private message
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5819
Location: Russian Federation

PostPosted: Fri Apr 11, 2014 7:50 am    Post subject: Reply with quote

Sir_SiLvA, plugin doesn't elevate itself, it just asks you to perform elevated operation (and you'll see elevation dialog anyway), just like when you're e.g. trying to copy file to C:\Windows.
And it is obviously much better way of doing things than starting elevated TC instance just to be able to manage services (or searching files via Everything, or editing registry, or anything else that requires elevation). Exclamation

BTW there is no way for plugin to elevate itself, Windows doesn't support elevating separate threads or modules.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Fri Apr 11, 2014 9:49 am    Post subject: Reply with quote

Sir_SiLvA wrote:
@Dalai: thanks for the work Exclamation havent tried it yet, but why is it called Services2 when it actually has to be called Services3 Question

Service-Plugin 1 was written by
Code:

      CompanyName: None
      FileDescription   : Services
      FileVersion   : 2, 4, 0, 214
      InternalName   : Services
      LegalCopyright   : Copyright © 2002-2004 by Serge Kandakov
      OriginalFilename   : Services.wfx
      ProductName   : Services plugin for Total Commander


Service-Plugin 2 was written by
Code:

      CompanyName: Jerry home
      FileDescription   : Service plugin for Total Commander
      FileVersion   : 1.0.0.0
      InternalName   : TC Services.wfx
      LegalCopyright   : Copyright (C) 2003-2005 by Jerry
      OriginalFilename: TC Services.wfx
      PrivateBuild   : 1.0.0.0
      ProductName   : TC Services
      ProductVersion   : 1.0.0.0

There is

However, I thought quite a while about the plugin's name (Services2, Services64, ServiceManager and so on) but didn't come up with a better name yet. If you do have a better name, feel free to post it here Smile.

Quote:
Edit: at first look - why provide an example ini making one think you store data in same directory as plugin is (what i prefer over anything else) when the Plugin itself shows %commder_path%\fsplugin.ini as storage place of ini settings?

Uh, no. Services2 stores its settings in fsplugin.ini, which is stored where wincmd.ini is located. If TC is installed on Vista or higher, wincmd.ini is - by default - stored in %AppData%\Ghisler (IIRC) - so fsplugin.ini defaults to %AppData%\Ghisler\fsplugin.ini on Vista and higher. The Services2.ini.sample is there to give the user an easy starting point for making the plugin portable (or store its settings in plugin directory which I prefer, too). I know, it looks a bit "out of place" to use fsplugin.ini if it's stored in %COMMANDER_PATH% but that's how it is, as it's the proper location on Vista and higher.

Furthermore it's not recommended to provide <pluginname>.ini because of probable update problems - see first post of this thread.

Regards
Dalai
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Fri Apr 11, 2014 11:30 am    Post subject: Reply with quote

MVV wrote:
Yes, you should write your own admin tool that will connect pipe opened in TC process by your plugin, and then it will accept and execute commands that your plugin sends to it.

Are you sure the plugin should open the pipe? What about multiple plugin instances?

I've written another program that uses pipes some time ago where I used unit Pipes by Russell Libby. That unit contains TPipeServer and TPipeClient (and TPipeConsole which isn't relevant here).

I fiddled about with this unit and now I'm confused where to use which component. Let's assume the plugin opens the pipe (using TPipeServer) and the admin tool connects to it (using TPipeClient). As long as there is one plugin instance all is well. A second plugin instance could open another pipe instance but the client (admin tool) listens only on the first instance (and switches to the second one if the first one is closed). I hope you can understand the problem.

Wouldn't it be better to do it the other way around: the admin tool opens the pipe and all plugin instances connect to it as clients? I know that I would have to wait in the plugin until the pipe is created.

Any advice and/or ideas?

Thanks and regards
Dalai
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5819
Location: Russian Federation

PostPosted: Fri Apr 11, 2014 12:21 pm    Post subject: Reply with quote

AFAIK it is impossible for non-elevated process to initiate communication with elevated one via pipe: it would be a security hole. That's why admin instance should do it.

There shouldn't be multiple instances within same TC installation. Anyway you may simply start one admin tool per plugin instance, just like TC does.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Fri Apr 11, 2014 1:35 pm    Post subject: Reply with quote

MVV wrote:
AFAIK it is impossible for non-elevated process to initiate communication with elevated one via pipe: it would be a security hole.

Interesting, because that's exactly what TC seems to do. I've looked at the imports of TC's files and only tcmadmin.exe imports CreateNamedPipe, totalcmd.exe doesn't.

Quote:
Anyway you may simply start one admin tool per plugin instance, just like TC does.

At first, I've tried to avoid this, but maybe it's easier this way.

Regards
Dalai
Back to top
View user's profile Send private message Send e-mail
MVV
Power Member
Power Member


Joined: 03 Aug 2008
Posts: 5819
Location: Russian Federation

PostPosted: Sat Apr 12, 2014 2:18 am    Post subject: Reply with quote

If you look at TCMADMIN command line, it seems that TC passes pipe identifier like 2128 and machine id. And, in handles you can find opened file like \Device\NamedPipe\TcPipe2128.

Quote:
At first, I've tried to avoid this, but maybe it's easier this way.

I think every TC instance's plugin should ask for elevation anyway, so it is OK.
_________________
TCFS2 + TCFS2Tools: Full-screen mode for TC etc (forum)
TOTALCMD.NET: AskParam, CopyTree, NTLinks, Sudo, VirtualPanel…
Back to top
View user's profile Send private message Send e-mail
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Sat Apr 12, 2014 4:51 am    Post subject: Reply with quote

MVV wrote:
If you look at TCMADMIN command line, it seems that TC passes pipe identifier like 2128 and machine id.

Yes, I've seen that, but I'm not sure it's only the pipe identifier. From what I've been able to determine, it's the PID of the current TC process, so tcmadmin.exe knows which pipe to open (which then of course has TC's PID appended). The second parameter is the fully-qualified account name, which I guess tcmadmin uses to set the security descriptor before opening the pipe (to avoid opening a security hole).

Regards
Dalai
Back to top
View user's profile Send private message Send e-mail
HAL 9000
Senior Member
Senior Member


Joined: 10 Sep 2007
Posts: 315

PostPosted: Sat Apr 12, 2014 6:55 am    Post subject: Reply with quote

disregard this (or please delete)

Last edited by HAL 9000 on Sun Apr 13, 2014 4:36 pm; edited 1 time in total
Back to top
View user's profile Send private message
Dalai
Power Member
Power Member


Joined: 28 Jan 2005
Posts: 3463
Location: Meiningen (Südthüringen)

PostPosted: Sat Apr 12, 2014 7:26 am    Post subject: Reply with quote

@HAL 9000: Are we talking about the same plugin? There are no events in Services2, nor are there any warnings, errors and so on.

And, multi-sorting is supported in custom columns as well as in details view mode, of course. I just tested it again successfully. TC does the sorting, the plugin hasn't to do anything special to make it work.

Regards
Dalai
Back to top
View user's profile Send private message Send e-mail
petermad
Power Member
Power Member


Joined: 05 Feb 2003
Posts: 5795
Location: Valsted, Denmark

PostPosted: Sat Apr 12, 2014 1:20 pm    Post subject: Reply with quote

Danish translation of Services2 v. 0.4.0 kan be downloaded here: http://madsenworld.dk/tcmd/wfx_Services2_0.4.0_dan.zip
_________________
#524
Danish Total Commander Translator
Win XP 32bit SP3 & Win 7 64bit SP1 & Win 8.1 64bit. TC 8.51 32+64bit, TC 2.05b2d

Get Extended Total Commander Menus
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group