UnRAR

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

But not on RAR.

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: UnRAR

Post 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

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: UnRAR

Post 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...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

I assume 7z.dll is freely distributable (like UnRAR.dll)?

Leito
Posts: 562
Joined: 26 Sep 2016 15:37
Location: Windows 10 1809 x64

Re: UnRAR

Post 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

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

OK, that's no problem at all.

So, for 19.50 I plan to look deeper into these nice little helpers... :tup:

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: UnRAR

Post 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;
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

Indeed, great! :tup:

Again it does not seem to support Unicode. :eh: I begin to wonder if this is my bug... something wrong with runret...

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: UnRAR

Post 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.
To see the attached files, you need to log into the forum.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

Very good, thanks! :tup: I go hunting... :twisted:

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: UnRAR

Post 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 :oops: :oops:
To see the attached files, you need to log into the forum.

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post 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.

jupe
Posts: 3478
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: UnRAR

Post 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.

admin
Site Admin
Posts: 66729
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: UnRAR

Post by admin »

Yes, I plan the thorough DLL approach for later. Right now I go for the quick and dirty.

elqasar2
Posts: 255
Joined: 27 Oct 2017 14:04
Location: Win 11, 100% scaling, v27.20.0700

Re: UnRAR

Post 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.

Post Reply