3

I have two directories which contain a handful of *.jar and *.war archives, as well as some metadata files and a file with *.spring extension, which is really just a zip file with an odd name. Something like this:

- dist1
    - a subfolder
        - some text file.txt
    - application-context.xml
    - arch1.jar
    - arch2.jar
    - arch3.jar
    - super-cool.war
    - xtremely-awesome.spring
- dist2
    - a subfolder
        - some text file.txt
    - application-context.xml
    - arch1.jar
    - arch2.jar
    - arch3.jar
    - super-cool.war
    - xtremely-awesome.spring

I'd like to do directory comparison on these directories, comparing the archives as if they were subfolders rather than binary files. Other files, both text and binary files both outside and inside the archives, should be compared as usual.

I know I could just explode all the archives manually and compare the exploded versions, but since they are generated by a build script and exploding them adds a considerable amount of time for building the project, it would be nicer to just do it for the comparison, preferrably within the diff tool.

I've tried using WinMerge with the 7zip plugin, but I can't get the plugin to work (the files are not recognized as archives in the folder compare view). I've tried both installing as a "shared installation" and as an "application specific installation" (pointing the installer to C:\Programs\WinMerge\WinMergeU.exe). I've also tried manually copying the .dll files from the plugin into the MergePlugins folder, without success.

How do I get this working in WinMerge? And if it's not possible, is there some other good tool that has this capability?

Tomas Aschan
  • 58,548
  • 56
  • 243
  • 402

3 Answers3

4

WinMerge FAQ section 6.4:

Can WinMerge open archive files with non-standard file-extensions? (For example .jar files as zip-files)

Yes: click the Options button (or click Edit → Options). In the Archive Support page, enable the Detect archive type from file signature option.

Community
  • 1
  • 1
aleung
  • 9,848
  • 3
  • 55
  • 69
  • Currently found in section 5 of the FAQ. Also a fresh install of the current stable version, 2.16.12, auto-detected and compared .jar files without selecting that option. – jla Jun 11 '21 at 16:43
4

Since WinMerge 2.15.2 (2018-01-28), archives are supported out of the box. See the change log section "Archive support" for changes to the functionality.

For the 2.15.2 release, the changelog says:

Archive support

  • Install 7-zip plugin by default

Options dialog

  • ...
  • Remove "Use stand-alone 7-Zip if available" and "Use local 7-Zip from WinMerge folder" radio button from "Archive Support" page (Now always use local 7-Zip from WinMerge folder)
  • ...

In WinMerge 2.14.01, the easiest way to enable archive support is to

  • download the 7-Zip plugin for WinMerge2,
  • use its installer to install the DLLs and related components for the latest 7-Zip supported into the folder of WinMerge3 (select the “Application specific installation” and “Enable standalone operation”), and
  • change the WinMerge settings to use these files and detect archive type automatically (in “Options → Archive Support” select “Enable archive file support”, “Use local 7-Zip from WinMerge folder” and “Detect archive type from file signature”).

Plugin installer with correct final settings screenshot
Image and the solution are by jtuc, the developer of WinMerge. I found them in a WinMerge forum thread.

Then, if you compare two JAR files (or files in any other archive-based format, e.g. ODF or OOXML), their contents should be compared as if they were extracted first. It works for me on Windows 10.

Some details on installing archive support are mentioned in the WinMerge manual.

1 WinMerge 2.14.0 is the latest stable release as of 2017-06, released on 2013-02-03.
2 Merge7z DllBuild 0028 is the latest as of 2015-09, released at 2010-12-28.
3 The DLLs are Merge7z920.dll and Merge7z920U.dll for 7-Zip 9.20 in Merge7z DllBuild 0028, and the path to WinMerge executable is probably C:\Program Files (x86)\WinMerge\WinMergeU.exe. The “U” stands for Unicode in both the DLL’s and executable’s name. For WinMergeU.exe, only Merge7z920U.dll is needed, but better have both and don’t have to care.

Palec
  • 12,743
  • 8
  • 69
  • 138
  • Fast forward nearly two years, there are still no updates to WinMerge, nor its 7-zip plugin. Still, at least some activity is bubbling in its repository and there are forks (it's under GPL). I very much hope that it will not die. – Palec Jun 22 '17 at 06:56
  • BTW the installer does not let you select `Merge7z920U.dll` without `Merge7z920.dll`. Also, installing the DLLs frees you from the need to install an old 32b version of 7-Zip. Installing the most recent 64b version is a good idea, though, as 7-Zip is the best archive a compression tool available and it has great shell integration. – Palec Jun 22 '17 at 08:53
  • Thanks for the heads up, @jla. Did not need this functionality for a long time or I might not have noticed it works OOTB and just took it for granted. Either way, I can confirm it works OOTB and I added that info in my answer along with the changelog reference. – Palec Jun 18 '21 at 09:44
2

If you want compare difereneces directories with files type *.jar, *.war , *.ear..etc a good options is beyond compare software http://www.scootersoftware.com/. Is not free but you have a trial option to prove it. It is multi-platform linux, windows or macosx.

Alex Carod
  • 131
  • 1
  • 8