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

Here you can discuss about your favorite plug-in.
2useven10
Posts: 5192
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 309 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: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 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: 5192
Joined: Mon 07 Sep, 2009 10:40
Has thanked: 18 times
Been thanked: 309 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: 129
Joined: Sun 08 Jan, 2012 08:23
Location: Czech Republic
Has thanked: 2 times
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: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 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: 10806
Joined: Tue 30 Aug, 2005 17:21
Has thanked: 220 times
Been thanked: 357 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
User avatar
buniak_a_h
Posts: 4234
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 222 times
Been thanked: 642 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: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 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.
User avatar
buniak_a_h
Posts: 4234
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 222 times
Been thanked: 642 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).
User avatar
buniak_a_h
Posts: 4234
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 222 times
Been thanked: 642 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.  
  3. local Exec = require"Execute"
  4.  
  5. ---------------------------------------------------------------------
  6.  
  7. local DeArcGUID = win.Uuid('97877FD0-78E6-4169-B4FB-D76746249F4D')
  8.  
  9. local PassInGUID =  win.Uuid('761F3B4C-FC45-4A9D-A383-3F75D505A43B')
  10.  
  11. ---------------------------------------------------------------------
  12.  
  13. local LastPass = nil
  14.  
  15. ---------------------------------------------------------------------
  16.  
  17. Event {
  18.  
  19.   id = "D5E500D0-8905-48FE-A80D-8B16B55CDF5D";
  20.  
  21.   group       = "DialogEvent";
  22.  
  23.   description = "Закрытие диалога задания на распаковку";
  24.  
  25.   condition   = function(Event, Param)
  26.  
  27.     if not APanel.Plugin and Event == F.DE_DLGPROCEND then
  28.  
  29.       local DlgId = Param.hDlg:send(F.DM_GETDIALOGINFO)
  30.  
  31.       DlgId = DlgId and DlgId.Id
  32.  
  33.       if DlgId then
  34.  
  35.         return DlgId == DeArcGUID and
  36.  
  37.                Param.Msg == F.DN_CLOSE and
  38.  
  39.                Param.Param1 == 19
  40.  
  41.       end
  42.  
  43.     end
  44.  
  45.   end;
  46.  
  47.   action = function(Event, Param)
  48.  
  49.     LastPass = Param.hDlg:send(F.DM_GETTEXT, 17)
  50.  
  51.     if LastPass == '' then LastPass = nil end
  52.  
  53.   end;
  54.  
  55. }
  56.  
  57. ---------------------------------------------------------------------
  58.  
  59. Event {
  60.  
  61.   id = "0B45ED03-8877-4B6D-BD54-2A0B19ACF818";
  62.  
  63.   group       = "DialogEvent";
  64.  
  65.   description = "Диалог ввода пароля";
  66.  
  67.   condition   = function(Event, Param)
  68.  
  69.     local DlgId = Param.hDlg:send(F.DM_GETDIALOGINFO)
  70.  
  71.     if DlgId and  DlgId.Id and Event == F.DE_DLGPROCEND then
  72.  
  73.       local Id = DlgId.Id
  74.  
  75.       Param.Id = Id
  76.  
  77.       return Id == PassInGUID
  78.  
  79.     end
  80.  
  81.   end; -- condition
  82.  
  83.   action      = function(Event, Param)
  84.  
  85.     local hDlg, Msg, Param1 = Param.hDlg, Param.Msg, Param.Param1
  86.  
  87.     if Msg == F.DN_INITDIALOG and LastPass ~= nil then
  88.  
  89.       -- Проверка пароля
  90.  
  91.       local RetCode = Exec('7z.exe t -p'..LastPass..' '..APanel.Path .. '\\' ..  mf.fsplit(hDlg:send(F.DM_GETTEXT, 2), 12) ).ExitCode
  92.  
  93.       if RetCode == 0 then --or Testing then
  94.  
  95.         hDlg:send(F.DM_SETTEXT, 4, LastPass)
  96.  
  97.         hDlg:send(F.DM_CLOSE, 6)
  98.  
  99.       end
  100.  
  101.     elseif Msg == F.DN_CLOSE and Dlg.GetValue(Param1, 9) == 1 then --and not Testing then
  102.  
  103.       LastPass = hDlg:send(F.DM_GETTEXT, 4)
  104.  
  105.     end
  106.  
  107.   end; -- action
  108.  
  109. }
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: 604
Joined: Sun 13 Jul, 2008 11:18
Has thanked: 17 times
Been thanked: 54 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...
User avatar
buniak_a_h
Posts: 4234
Joined: Sat 20 Apr, 2013 00:17
Location: Санкт-Петробад
Has thanked: 222 times
Been thanked: 642 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”