Page 1 of 3

UnRAR

Posted: 13 Nov 2018 07:00
by admin
I'm trying to support previewing RAR files, but at least here it does not seem to support unicode filenames within the archive. :?

If you have WinRAR installed:
Please pack some files with Unicode characters (eg 日本人) to a RAR, then try this script (fill in the placeholders):

Code: Select all

text runret('"<full path to UnRAR.exe>" lb "<full path RAR archive>"');

Re: UnRAR

Posted: 13 Nov 2018 07:18
by jupe
I can't get them to display either, I just get ???.

Would love to see MUSD for RAR files though, even without unicode support. :tup:

Re: UnRAR

Posted: 13 Nov 2018 07:22
by admin
So it's like here: It works, but no Unicode characters. (And other than ZIP it recurses any packed directories, right?)

Re: UnRAR

Posted: 13 Nov 2018 07:25
by jupe
Yes it works, no unicode, and it recurses

Maybe using UnRAR.dll instead might work?

https://www.rarlab.com/rar/UnRARDLL.exe

Re: UnRAR

Posted: 13 Nov 2018 08:30
by admin
jupe wrote: ↑13 Nov 2018 07:25 Maybe using UnRAR.dll instead might work?

https://www.rarlab.com/rar/UnRARDLL.exe
Wow, now that's a totally different story! :cup: So, full RAR support looks possible now. I will look at this for 19.50.... thanks a lot!

Re: UnRAR

Posted: 14 Nov 2018 06:48
by Zach
Does this actually require WinRAR / UnRAR to be installed?

Don't like the idea of having to install something I don't actually use/need (WinRAR) just to be able to preview some files, tbh. Is it possible to expand this support to other handlers of peoples preferred choice? (for instance I use 7zip) or can the UnRAR thing be included without any licensing issues

Re: UnRAR

Posted: 14 Nov 2018 09:08
by Borut
In my version (year 2011) the WinRar License.txt states:
5.a. No person or company may distribute separate parts of the package with the exception of the UnRAR components, without written permission of the copyright owner.
The same is true for the current German site (http://www.winrar.de/eula.php):
3. Die unlizenzierte Testversion der Software darf ohne Einschränkungen verbreitet werden, sofern Umfang und Inhalt des Originalpakets nicht verändert werden. Es gelten folgende Einschränkungen:

a. Niemand darf Teile des Original-Programmpakets (mit Ausnahme der Komponenten von UnRAR) ohne die schriftliche Genehmigung des Urheberrechtsinhabers verbreiten.

[...]
So UnRAR could even be distributed freely, but no one here does even that. You could download it yourself and use it from XYplorer freely (and it does not need to be installed in order to work from XYplorer - I explicitly made a separate folder for UnRar and tweaked XY accordingly). At least this is my understanding of the above.

However, the support of 7z is something I am wishing and hoping for too. (And also perhaps some more general support for connecting to (more than one?) compressed content previewing exes/dlls.)

Re: UnRAR

Posted: 14 Nov 2018 10:07
by admin
If 7zip supports a command line switch that returns the contents of the archives then it's possible. Currently I got no time to research that. If you like you can try using the runret() scripting command... If runret can do it then XY can do it.

Re: UnRAR

Posted: 14 Nov 2018 10:26
by highend

Code: Select all

7za.exe l "<path>\<archive file>"
7za = 7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager (additional download)
E.g. for the current version: https://www.7-zip.org/a/7z1805-extra.7z

Re: UnRAR

Posted: 14 Nov 2018 15:13
by admin
highend wrote: ↑14 Nov 2018 10:26

Code: Select all

7za.exe l "<path>\<archive file>"
7za = 7-Zip Extra: standalone console version, 7z DLL, Plugin for Far Manager (additional download)
E.g. for the current version: https://www.7-zip.org/a/7z1805-extra.7z
Yes, it works, but the result is hard to parse. Not machine friendly:

Code: Select all

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


Re: UnRAR

Posted: 14 Nov 2018 15:39
by highend
In XY scripting:

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 = regexmatches($text, strrepeat("-", 24) . "[\s\S]*?(?=\r?\n" . strrepeat("-", 19). ")");
    $data = regexreplace($data, "^-.*(\r?\n|$)");
    $data = regexreplace($data, "^.{53}");
    text $data;
Output:

Code: Select all

AeroMongolia.jpg
Burma_Shave_Tube.jpg

Re: UnRAR

Posted: 14 Nov 2018 15:48
by admin
:) Thanks!

When I find the time...

Re: UnRAR

Posted: 14 Nov 2018 16:41
by Leito
7-zip support would be an advantage as it could be used for a lot more of archive formats than WinRAR:
Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
Unpacking only: AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z
Compared to WinRAR:
Packing / unpacking: RAR, ZIP
Unpacking only: CAB, ARJ, LZH, TAR, GZ, ACE, UUE, BZ2, JAR, ISO, 7Z, XZ, Z
Plus 7-Zip is free, open-source, blah blah.

Re: UnRAR

Posted: 14 Nov 2018 16:56
by admin
I thought that as well, but

Code: Select all

7za.exe l "<path>\<archive file>"
does not seem to work on formats other than 7z. :(

Re: UnRAR

Posted: 14 Nov 2018 16:58
by highend
It works fine on a .zip file here...