[WCX] 7-zip plugin ver. 0.4.x

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

Moderators: Hacker, petermad, Stefan2, white

Post Reply
ono
Junior Member
Junior Member
Posts: 52
Joined: 2003-12-22, 11:37 UTC
Location: Zurich Area, Switzerland

[WCX] 7-zip plugin ver. 0.4.x

Post by *ono »

Last version of the 7Zip plugin for TC can be found there:
http://www.totalcmd.net/plugring/7zip_plugin.html


(This software is published under GPL)

Please post comments in this thread if any :)

Note! This plugin does not require installation of 7Zip package.

Best regards,
Last edited by ono on 2005-01-13, 12:45 UTC, edited 6 times in total.
TC Personal license #99581
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2ono
Hello,

first thank you very much :D Finally someone started a 7-ZIP packer plugin project.
Plugin size is quite high because the all 7zip methods compiled in, you don't have to install 7zip prior running this plugin.
Plugin size is not a problem. We have UPX. But I want to make a hint that could be useful some day. The 7-ZIP developers changes some internals from time to time so it could be a good a idea to build a stable interface around the internal stuff. In consequence that means an extra library. I have also heard that there is already a DLL from the 7-ZIP developers which provides this but I'm not sure.
User avatar
deus-ex
Power Member
Power Member
Posts: 979
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex »

Lefteous wrote:The 7-ZIP developers...
Should'nt you know, actually 7-Zip was and is developed by only one man: Igor Pavlov.
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2deus-ex
Should'nt you know, actually 7-Zip was and is developed by only one man: Igor Pavlov.
No, I didn't know that.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Post by *Clo »

2deus-ex
Should'nt you know, actually 7-Zip was and is developed by only one man: Igor Pavlov.
:) Hello Dirk !
- Do you mean : the man with bells and dogs ? :P :lol:
:mrgreen: Friendly,
Claude
Clo
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Hacker
Moderator
Moderator
Posts: 13141
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Nope, that was Ivan. :)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Localizable---

Post by *Clo »

2ono
:) Hello !
¤ Thank you for this initiative !
- Finally a wished reply to a redundant question…
{Lefteous wrote}…so it could be a good idea to build a stable interface around the internal stuff. In consequence that means an extra library…
- It should be nice if that interface could be localizable…
- Another important point, IMHO is described here and next.
- Please, could you consider it?

:mrgreen: Kind regards,
Claude
Clo
Last edited by Clo on 2004-12-19, 02:04 UTC, edited 1 time in total.
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
User avatar
Ergo
Senior Member
Senior Member
Posts: 204
Joined: 2003-02-05, 12:20 UTC
Location: Belarus
Contact:

Post by *Ergo »

Should'nt you know, actually 7-Zip was and is developed by only one man: Igor Pavlov.
Who is fan of FAR manager not Total Commander :) That is why there is plugin for FAR and there is no plugin for Total Commander :)
Wincmd.ru WWW.TOTALCMD.NET
I see that future is near...
User avatar
Lefteous
Power Member
Power Member
Posts: 9536
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Clo
I should be nice if that interface could be localizable…
In this case I didn't ment a user interface. I was talking of an interface between two pieces of software.
Of course the packer config dialog should be localizable. ;-)
ono
Junior Member
Junior Member
Posts: 52
Joined: 2003-12-22, 11:37 UTC
Location: Zurich Area, Switzerland

Re: Localizable---

Post by *ono »

Clo wrote: - Finally a wished reply to a redundant question…
{Lefteous wrote}…so it could be a good idea to build a stable interface around the internal stuff. In consequence that means an extra library…
You know 7zip interface is quite stable even it doesn't look like. For the first shot you can really get lost in the 7zip sourcecode.. but after all it's not bad designed and it's quite generic. So I don't think we need use any DLL or lib for inter communication with 7zip neither require any 7zip installation.

Going into details you can use general interfaces like IInArchive IInStream to do some generic extraction precesses using 7zip core - actually operating on C7zipArchive (it's transparent for you) which is implementation of IInArchive and does change, but IInArchive not !...

Moreover you can use all supported archives by 7zip that way. So my plugin could also handle bzip2, zip, cab, rar.. etc.

So since I use IInArchive interface methods I don't need mod my code when 7zip code changes, just recompile. So for me it's not really true that 7zip code changes was a big problem to start this project. However the volume of 7zip code and 7zip classes is a BIG problem at the beginning 8) especially deciding which .cpp you should compile and include in the build .
Clo wrote:- I should be nice if that interface could be localizable…
Sure but for the moment there's no UI :) Maybe later zome 7zip compression options.
Clo wrote:- Another important point, IMHO is described here and next.
Yea.. I know that problem. I'm also fighting with MS Sans Serif :wink: Only one valid IMO is MS Shell Dlg, also rest of the problems are known for me. As a dev of some Miranda IM plugins I headed lot of this sort of problems (You know than IM ??)

Cheers,
TC Personal license #99581
User avatar
Clo
Moderator
Moderator
Posts: 5731
Joined: 2003-12-02, 19:01 UTC
Location: Bordeaux, France
Contact:

Good way---

Post by *Clo »

2ono
:) Hello !
- Thanks for these details. I guess you chose a good way, although I'm not a programmer…
Only one valid IMO is MS Shell Dlg
- Most certainly, but there is a snag under Win 9x / NT : it uses its default font (stated in the Registry as MS Shell Dlg )
which is usually… the c****y MS Sans Serif !
- Hence, since it's always better to have a small *.INI file, the font could be chosen with instruction-rows in this *.INI ?
- So, the “poor” users of Win 9x could set [face=arial]Arial (Latin for me)[/face] or [face=tahoma]Tahoma (latin too…)[/face]

[face=verdana]• Like many users here I think, I'll test the next versions of your plugin with the best interest ;)

{ Aside : I'm a Miranda-IM user, and member of the English forum.
- The language system of Miranda is the best example of that one must NOT do ! :twisted: }

:mrgreen: Kind regards,
Claude
Clo[/face]
#31505 Traducteur Français de TC French translator Aide en Français Tutoriels Français English Tutorials
ono
Junior Member
Junior Member
Posts: 52
Joined: 2003-12-22, 11:37 UTC
Location: Zurich Area, Switzerland

Post by *ono »

New build implementing 7zip extraction is ready. It is considered to be unstable... I had to use multithreading to support basic progressbar routines. Sometimes it may hang your TC... sorry :( Code is still buggy.

Why all those problems !?

I must confess that this is real pain to implement 7zip in TC with the current TC packer API. 7zip is packed into one stream per folder which requires get extraction stream for all files @ folder at one moment.

This would be OK if TC send me array of indices which files to extract. But the ProcessFile callback routine does it one by one :evil: when 7zip requires me to specify all extracted files indexes before Extraction is launched.

Moreover I cannot do it like that... 1st I note down the indices (list of extracted files index) going trought ProcessFile then do the extraction then CloseArchive is launched... because it will hang TC when I do tProcessDataProc(...) with the non actual for ProcessFile filename.

So ... here it is... I'll try to make it less buggy... anyway now you're able do decompress 7z archives in TC.
TC Personal license #99581
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

No problem, you can handle it like this:
1. While receiving calls to ProcessFile with flag PK_EXTRACT or PK_TEST, just store the names in a linked list or a dynamic array.
2. Do the actual unpacking only when receiving CloseArchive. Calls to ProcessDataProc will only be made here.

I have once written a plugin for the sqx packer, which I never released due to a flaw in its api, which uses exactly this concept. Just contact me by e-mail if you want to have this code.
Author of Total Commander
https://www.ghisler.com
ono
Junior Member
Junior Member
Posts: 52
Joined: 2003-12-22, 11:37 UTC
Location: Zurich Area, Switzerland

Post by *ono »

2MrGhisler: BTW. I'm having also another strange problem....

When I open first.7z TC calls OpenArchive(...first.7z...) then ReadHeader(firstHandle) till END_ARCHIVE but no CloseArchive(firstHandle)

But when I go out from the archive and open second.7z in TC it calls ReadHeader(firstHandle) again instead of new OpenArchive(...second.7z...) !!! Why the hell !? I'm totally confused with this.

I tried to find out where's is the bug in my code... but failed. What I'm doing wrong !?

Regards,
TC Personal license #99581
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50390
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for sending me your code. Unfortunately I'm currently too busy to check it, but the above behaviour isn't normal at all.
Author of Total Commander
https://www.ghisler.com
Post Reply