Page 2 of 3
Re: UnRAR
Posted: 14 Nov 2018 17:00
by admin
But not on RAR.
Re: UnRAR
Posted: 14 Nov 2018 17:01
by jupe
If eventually you choose to incorporate functionality via a dll file, this is a link to the 7Zip source which includes an example of using the 7z.dll (which does multi format extraction), unlike the UnRAR.dll though there seems to be little documentation for using it, only the small example of using it in c++.
https://www.7-zip.org/a/7z1805-src.7z
Re: UnRAR
Posted: 14 Nov 2018 17:02
by highend
7za.exe (a = alone) is a standalone version of 7-Zip. 7za.exe supports only 7z, xz, lzma, cab, zip, gzip, bzip2 and tar formats. 7za.exe doesn't use external modules.
For more you probably need to use the 7z.dll...
Re: UnRAR
Posted: 14 Nov 2018 17:05
by admin
I assume 7z.dll is freely distributable (like UnRAR.dll)?
Re: UnRAR
Posted: 14 Nov 2018 17:07
by Leito
The licenses for files are:
1) 7z.dll:
- The "GNU LGPL" as main license for most of the code
- The "GNU LGPL" with "unRAR license restriction" for some code
- The "BSD 3-clause License" for some code
https://www.7-zip.org/license.txt
Re: UnRAR
Posted: 14 Nov 2018 17:08
by admin
OK, that's no problem at all.
So, for 19.50 I plan to look deeper into these nice little helpers...

Re: UnRAR
Posted: 14 Nov 2018 18:35
by highend
You can just use 7z.exe (which uses the 7z.dll) to do what's required. It supports all packing formats, incl. rar
and btw, the filtering of the output can be shortened to:
Code: Select all
$text = <<<>>>
7-Zip (a) 18.05 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30
Scanning the drive for archives:
1 file, 571665 bytes (559 KiB)
Listing archive: E:\Test\Archives\7zip\Mongolia.7z
--
Path = E:\Test\Archives\7zip\Mongolia.7z
Type = 7z
Physical Size = 571665
Headers Size = 203
Method = LZMA:768k
Solid = +
Blocks = 1
Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2016-10-24 08:47:03 ....A 343262 571462 AeroMongolia.jpg
2018-10-23 15:07:35 ....A 244577 Burma_Shave_Tube.jpg
------------------- ----- ------------ ------------ ------------------------
2018-10-23 15:07:35 587839 571462 2 files
>>>;
$data = regexreplace($text, "(^7-Zip[\s\S]*?[-]{24}\r?\n)([\s\S]*?)(\r?\n[-]{19}[\s\S]*)", "$2");
$data = regexreplace($data, "^.{53}");
text $data;
Re: UnRAR
Posted: 14 Nov 2018 19:17
by admin
Indeed, great!
Again it does not seem to support Unicode.

I begin to wonder if this is
my bug... something wrong with runret...
Re: UnRAR
Posted: 14 Nov 2018 20:14
by Marco
Don, here's my test.
Appunti-20181114.png
If I copy-paste that content in a text editor I get this:
Code: Select all
Microsoft Windows [Versione 6.3.9600]
(c) 2013 Microsoft Corporation. Tutti i diritti riservati.
C:\Users\Marco>cd desktop
C:\Users\Marco\Desktop>"C:\Program Files\WinRAR\UnRar.exe" lb C:\Dati\Marco\Desk
top\日本人.rar
日本人.txt
C:\Users\Marco\Desktop>
So it "should" work. I didn't change codepage via chcp, but I changed the font used by console (right click on the title bar > properties > font type). I don't know why runret shows only ?s, I even tried changing codepage before launching the actual command in your first post.
Re: UnRAR
Posted: 14 Nov 2018 20:30
by admin
Very good, thanks!

I go hunting...

Re: UnRAR
Posted: 15 Nov 2018 06:13
by jupe
From my tests 7z.exe doesn't support UniCode, does anyone else have it working? (I tried as RAR4/5/7z packed files)
edit: oops just noticed Don already mentioned that

Re: UnRAR
Posted: 15 Nov 2018 08:21
by admin
7zip itself supports Unicode, only the listing of the contents per commandline somewhere loses the information. It's interesting that the characters are replaced by "_" as opposed to the usual "?". Still a mystery but I'm sure it will be solved soon.
Re: UnRAR
Posted: 15 Nov 2018 08:59
by jupe
Yes that's what I meant, I shouldn't have used the word "support". So to me it looks like in the case of unrar it's a runret issue, but the 7zip listing is a 7zip problem that won't be fixable without 7zip code changes AFAICT or using the dll directly because I assume GUI 7z shows Unicode properly.
Re: UnRAR
Posted: 15 Nov 2018 09:27
by admin
Yes, I plan the thorough DLL approach for later. Right now I go for the quick and dirty.
Re: UnRAR
Posted: 15 Nov 2018 21:01
by elqasar2
For those who only have WinRAR installed, is it not possible to have it handle the Hover Box preview for 7z as well? Using the WinRAR GUI application I can open and extract 7z files just fine.