arclite - 7-Zip backed plug-in for handling archives

Here you can discuss about your favorite plug-in.
2useven10
Posts: 4381
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 7 times
Been thanked: 227 times

arclite - 7-Zip backed plug-in for handling archives

Post by 2useven10 »

Latest post of the previous page:

DrKnS wrote: Mon 09 Sep, 2019 13:43It does.

Code: Select all

C:\0>far "C:\0\2 2"
2"" was unexpected at this time.
"C:\0\2 2" is directory
Last edited by 2useven10 on Mon 09 Sep, 2019 14:03, edited 1 time in total.
User avatar
HaRT
Moderator
Posts: 9916
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 141 times
Been thanked: 278 times

arclite - 7-Zip backed plug-in for handling archives

Post by HaRT »

2useven10, "C:\Program Files (x86)\Far Manager\Far.exe" "C:\Documents and Settings" works as expected for me both in cmd and in Far (both by Enter and by ShiftEnter).
Фар есть инструмент, а не нянька. © 2009 DrKnS
2useven10
Posts: 4381
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 7 times
Been thanked: 227 times

arclite - 7-Zip backed plug-in for handling archives

Post by 2useven10 »

DrKnS wrote: Mon 09 Sep, 2019 13:43It does.
Yes it does. The problem was far.bat in my PATH.
Last edited by 2useven10 on Mon 09 Sep, 2019 14:14, edited 1 time in total.
KlepetoX
Posts: 122
Joined: Sun 08 Jan, 2012 08:23
Location: Czech Republic
Has thanked: 1 time
Been thanked: 1 time

arclite - 7-Zip backed plug-in for handling archives

Post by KlepetoX »

DrKnS:
KlepetoX, you can use arc:"\"c:\archive\right archive.zip\""
Though I don't understand it at all, it works well. Great solution. Thank you...
pepak
Posts: 566
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 48 times

arclite - 7-Zip backed plug-in for handling archives

Post by pepak »

When extracting from multiple password-protected archives at once (select many archives, SHIFT+F2), ArcLite asks for password separately for each archive. Would it be possible to first try the password from the last file and only if it fails, ask for a new password? The current implementation requires that I be constantly on the computer if I want to extract multiple archives, rather than enter the password once and then extract them all.
User avatar
HaRT
Moderator
Posts: 9916
Joined: Tue 30 Aug, 2005 17:21
Location: Санкт-Петербург
Has thanked: 141 times
Been thanked: 278 times

arclite - 7-Zip backed plug-in for handling archives

Post by HaRT »

pepak wrote: Thu 16 Sep, 2021 16:47 When extracting from multiple password-protected archives at once (select many archives, SHIFT+F2), ArcLite asks for password separately for each archive.
The same happens even if I provide the password in the initial Extract dialog, and even when I Extract/Test via the plug-in's menu, which is somewhat surprising.
If I want to extract/test multiple archives encrypted with different passwords, I'm fine to issue the command once per each same-password group.
Фар есть инструмент, а не нянька. © 2009 DrKnS
buniak_a_h
Posts: 3164
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 167 times
Been thanked: 466 times
Contact:

arclite - 7-Zip backed plug-in for handling archives

Post by buniak_a_h »

pepak, sorry for my english. See here, maybe it will be useful for you…
pepak
Posts: 566
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 48 times

arclite - 7-Zip backed plug-in for handling archives

Post by pepak »

pepak, sorry for my english. See here, maybe it will be useful for you…
Well, yes and no. I rather admire how you can do all of that in a script (I especially like the positioning of the editbox, that's really neat) and it does solve the issue to a degree. In this way, it is useful. But:

1) Notice how complex the script is, compared to what a simple change in ArcLite would require - simply not resetting the password between files.

2) It woks fine if the number of files is small. It's much less practical if there are 20 files, much less if there are 100 files.

For this reason I hope that a change will make it into ArcLite itself. If not, I guess I will have to learn how to compile plugins, something I haven't done before.
Last edited by pepak on Thu 23 Sep, 2021 04:46, edited 1 time in total.
buniak_a_h
Posts: 3164
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 167 times
Been thanked: 466 times
Contact:

arclite - 7-Zip backed plug-in for handling archives

Post by buniak_a_h »

pepak wrote: Thu 23 Sep, 2021 04:45 It woks fine if the number of files is small.
A new version has select/unselect service (see hint below).
buniak_a_h
Posts: 3164
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 167 times
Been thanked: 466 times
Contact:

arclite - 7-Zip backed plug-in for handling archives

Post by buniak_a_h »

pepak, if you have 7z.exe on your conputer, the next script performs your wishes exactly:
  1. local F = far.Flags
  2. local Exec = require"Execute"
  3. ---------------------------------------------------------------------
  4. local DeArcGUID = win.Uuid('97877FD0-78E6-4169-B4FB-D76746249F4D')
  5. local PassInGUID =  win.Uuid('761F3B4C-FC45-4A9D-A383-3F75D505A43B')
  6. ---------------------------------------------------------------------
  7. local LastPass = nil
  8. ---------------------------------------------------------------------
  9. Event {
  10.   id = "D5E500D0-8905-48FE-A80D-8B16B55CDF5D";
  11.   group       = "DialogEvent";
  12.   description = "Закрытие диалога задания на распаковку";
  13.   condition   = function(Event, Param)
  14.     if not APanel.Plugin and Event == F.DE_DLGPROCEND then
  15.       local DlgId = Param.hDlg:send(F.DM_GETDIALOGINFO)
  16.       DlgId = DlgId and DlgId.Id
  17.       if DlgId then
  18.         return DlgId == DeArcGUID and
  19.                Param.Msg == F.DN_CLOSE and
  20.                Param.Param1 == 19
  21.       end
  22.     end
  23.   end;
  24.   action = function(Event, Param)
  25.     LastPass = Param.hDlg:send(F.DM_GETTEXT, 17)
  26.     if LastPass == '' then LastPass = nil end
  27.   end;
  28. }
  29. ---------------------------------------------------------------------
  30. Event {
  31.   id = "0B45ED03-8877-4B6D-BD54-2A0B19ACF818";
  32.   group       = "DialogEvent";
  33.   description = "Диалог ввода пароля";
  34.   condition   = function(Event, Param)
  35.     local DlgId = Param.hDlg:send(F.DM_GETDIALOGINFO)
  36.     if DlgId and  DlgId.Id and Event == F.DE_DLGPROCEND then
  37.       local Id = DlgId.Id
  38.       Param.Id = Id
  39.       return Id == PassInGUID
  40.     end
  41.   end; -- condition
  42.   action      = function(Event, Param)
  43.     local hDlg, Msg, Param1 = Param.hDlg, Param.Msg, Param.Param1
  44.     if Msg == F.DN_INITDIALOG and LastPass ~= nil then
  45.       -- Проверка пароля
  46.       local RetCode = Exec('7z.exe t -p'..LastPass..' '..APanel.Path .. '\\' ..  mf.fsplit(hDlg:send(F.DM_GETTEXT, 2), 12) ).ExitCode
  47.       if RetCode == 0 then --or Testing then
  48.         hDlg:send(F.DM_SETTEXT, 4, LastPass)
  49.         hDlg:send(F.DM_CLOSE, 6)
  50.       end
  51.     elseif Msg == F.DN_CLOSE and Dlg.GetValue(Param1, 9) == 1 then --and not Testing then
  52.       LastPass = hDlg:send(F.DM_GETTEXT, 4)
  53.     end
  54.   end; -- action
  55. }
The only restriction is that the file name (without a path) should be placed in the password request dialog
This script uses module Execute
Last edited by buniak_a_h on Mon 27 Sep, 2021 07:37, edited 1 time in total.
pepak
Posts: 566
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 48 times

arclite - 7-Zip backed plug-in for handling archives

Post by pepak »

There's a catch, though: If you enter the password on command line, it will appear in many places in the operating system and can be easily recovered. That's what makes the ArcLite plugin preferable when extracting multiple archives - otherwise I would simply use the command line 7z.exe and not bother with any GUI...
buniak_a_h
Posts: 3164
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 167 times
Been thanked: 466 times
Contact:

arclite - 7-Zip backed plug-in for handling archives

Post by buniak_a_h »

Alas, the ArcLite plugin is not reentrant. Thus, just before unpacking the archive, it is impossible to call it to check the password. From the command line - easy.
Post Reply

Return to “General Plug-In Discussions”