Why do WinRAR and 7-Zip see different files when opening the same compressed file?

0

1

Example file jdk-7u67-windows-x64.exe is ~129MB (Oracle account is needed to download)

When using WinRAR, it shows the total is 29,170,176B:
jre.msi (~27.7MB)
jre1041.MST
jre2052.MST

However, when using 7-Zip, it shows the total is ~184MB:
tools.zip (which seems correct result to me)

According to the tutorials (How to Install JDK without Admin Rights) from Google search, they all use 7-Zip to extract the installer - Why is that?

user1686407

Posted 2019-12-23T07:52:31.747

Reputation: 103

Does when you open tools.zip in 7-Zip ("Open inside" command) then you see the same 3 files shown by Rar? – Akina – 2019-12-23T08:07:49.563

@Akina no, it shows totally different files. and I can't find jre.msi, jre1041.MST and jre2052.MST in it. – user1686407 – 2019-12-23T08:32:10.797

What if UNPACK this .exe using this 2 archivators into 2 separate folders - does this folders differs? – Akina – 2019-12-23T08:39:06.790

@Akina they are all different. – user1686407 – 2019-12-23T08:51:50.323

And none archivator reports any error? I can say nothing... look, does you really unpack the same file? – Akina – 2019-12-23T08:58:12.240

@Akina nope, they are extract successfully without any error. I know it sounds strange, this is why I give an example file. If you don't want sign up an oracle account, you can get one on BugMeNot. – user1686407 – 2019-12-23T09:28:11.347

If you don't want sign up an oracle account This is not a problem - I have such account. But I don't have RAR, and I don't want to install it, even as a trial version. – Akina – 2019-12-23T09:31:41.993

Let us continue this discussion in chat.

– user1686407 – 2019-12-23T09:43:45.970

Answers

4

It's an EXE, so not a standardized archive file.

There's a lot of installer package builders and each of them uses its proprietary file storage method. One thing they all have in common is that they store compressed data as an EXE resource. These are relatively easy to carve out, but a single EXE can contain plenty of different resources.

When you open an installer with an archiver, the archiver tries to guess which resource is the one you're interested in. WinRAR and 7-Zip make different guesses, so you get different content.

gronostaj

Posted 2019-12-23T07:52:31.747

Reputation: 33 047

so I just lucky that I can "open" the exe "correctly" with 7-Zip? – user1686407 – 2019-12-23T10:23:23.763

4Both ways are correct, one just happens to match your expectations. – gronostaj – 2019-12-23T10:25:33.233

But how can both 29MB and 184MB are correct result? WinRAR definitely miss something. – user1686407 – 2019-12-23T14:04:50.720

1WinRAR misses tools.zip. 7-Zip misses jre.msi, jre1041.MST and jre2052.MST. There's more than one extractable resource, both programs have to pick one. They make different choices. – gronostaj – 2019-12-23T14:10:04.573

Why not just pick everything? – user1686407 – 2019-12-24T01:36:58.710

1These apps were designed to open archives. In the world of archives one file = one archive. If you want to discuss why 7-Zip and WinRAR weren't somehow redesigned to extract installers (and "that's not what they are for" is not a satisfying answer to you), then you should ask their authors/maintainers. – gronostaj – 2019-12-24T07:27:01.587