Stop the "path detection" chaos!

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Stop the "path detection" chaos!

Post by *Lefteous »

There had been many discussion about detecting INI file and TC path.
The current discussion is in the TConsole thread where we should talk about TConsole. So I decided to start a new thread.

Many plugins require informations about current TC settings and require the TC path to read the Totalcmd.inc for example. There is currently no defined way to find out these values from an external program or a plugin. Here is what I suggest:

new Function for all plugin interfaces:

InitializePlugin (String INIFilePath, String FTPINIFilePath, String TCPath);

The function is called by TC after plugin the plugin has been loaded. The plugin author can now take the parameters and load settings or whatever.


For addon programs (I already made this suggestion in the german forum, but I think the plugin forum is a much better place):

Introduce %I for INI file path and %C for TC path to make it easier for an addon user to configure a new addon.
Example:

Command: %PROGRAMFILES%\Total Commander\Addons\Addon.exe
Parameters: /I:%I /C:%C

is much easier than the current situation, that looks like this:
Command: %Programfiles%\Total Commander\Addons\Addon.exe
Parameters: /I:"%APPDATA%\Total Commander\Totalcmd.ini" /C:"%PROGRAMFILES%\Total Commander"
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Lefteous's words about plugin .ini files are my words, too ;-).
I also hate the current situation (look for example TConsole thread).

I think we also should remember about lang files. Now we have different .lang .lng files, some of them are in plugin directory, other in plugin language subdirectory, and other in TC language subdirectory - What worse they sometimes have similar names: english.lng. It would be better if they eg. looked like versions plugin language files - ver_english.lng.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2djk
I think we also should remember about lang files. Now we have different .lang .lng files, some of them are in plugin directory, other in plugin language subdirectory, and other in TC language subdirectory - What worse they sometimes have similar names: english.lng. It would be better if they eg. looked like versions plugin language files - ver_english.lng.
each plugin could create a subdirectory in the directory where the Totalcmd.ini is located. The "versions"-plugin creates a "versions" subdirectory and can store all settings and language files here - no more conventions required.

I don't like lsplugin.ini and fsplugin.ini because you need to edit the file manually and delete the section if you have uninstalled the plugin. It's much easier to delete a directory.
User avatar
djk
Power Member
Power Member
Posts: 1651
Joined: 2003-03-17, 11:33 UTC
Location: Poland
Contact:

Post by *djk »

Lefteous wrote:2djk
each plugin could create a subdirectory in the directory where the Totalcmd.ini is located. The "versions"-plugin creates a "versions" subdirectory and can store all settings and language files here - no more conventions required.
It's also a good solution.
Lefteous wrote: I don't like lsplugin.ini and fsplugin.ini because you need to edit the file manually and delete the section if you have uninstalled the plugin. It's much easier to delete a directory.
I also don't like these files.
DJK
Totally addicted to Total Commander
totalcmd.pl
en.totalcmd.pl
Post Reply