UnRAR

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

UnRAR

Post 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>"');

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

Re: UnRAR

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

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

Re: UnRAR

Post by admin »

So it's like here: It works, but no Unicode characters. (And other than ZIP it recurses any packed directories, right?)

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

Re: UnRAR

Post by jupe »

Yes it works, no unicode, and it recurses

Maybe using UnRAR.dll instead might work?

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

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

Re: UnRAR

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

Zach
Posts: 23
Joined: 13 Aug 2012 19:42

Re: UnRAR

Post 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

Borut
Posts: 1412
Joined: 19 Oct 2010 19:29

Re: UnRAR

Post 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.)
Win 10 Pro 64bit

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

Re: UnRAR

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

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

Re: UnRAR

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

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

Re: UnRAR

Post 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


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

Re: UnRAR

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

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

Re: UnRAR

Post by admin »

:) Thanks!

When I find the time...

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

Re: UnRAR

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

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

Re: UnRAR

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

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

Re: UnRAR

Post by highend »

It works fine on a .zip file here...
One of my scripts helped you out? Please donate via Paypal

Post Reply