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?

4

3 回答 3

4

自 WinMerge 2.15.2 (2018-01-28) 起,开箱即用支持存档。有关功能的更改,请参阅更改日志部分“存档支持”。

对于 2.15.2 版本,变更日志说:

存档支持

  • 默认安装 7-zip 插件

选项对话框

  • ...
  • 从“存档支持”页面中删除“使用独立 7-Zip(如果可用)”和“使用 WinMerge 文件夹中的本地 7-Zip”单选按钮(现在始终使用 WinMerge 文件夹中的本地 7-Zip)
  • ...

在 WinMerge 2.14.0 1中,启用存档支持的最简单方法是

  • 下载WinMerge 2的7-Zip 插件
  • 使用其安装程序将支持的最新 7-Zip 的 DLL 和相关组件安装到 WinMerge 3的文件夹中(选择“应用程序特定安装”和“启用独立操作”),以及
  • 更改 WinMerge 设置以使用这些文件并自动检测存档类型(在“选项 → 存档支持”中选择“启用存档文件支持”、“使用 WinMerge 文件夹中的本地 7-Zip”和“从文件签名中检测存档类型”)。

具有正确最终设置屏幕截图的插件安装程序
图像和解决方案由 WinMerge 的开发者 jtuc 提供。我在WinMerge 论坛主题中找到了它们。

然后,如果您比较两个 JAR 文件(或任何其他基于存档格式的文件,例如 ODF 或 OOXML),则应该比较它们的内容,就好像它们首先被提取一样。它适用于我在 Windows 10 上。

WinMerge 手册中提到了有关安装存档支持的一些详细信息。

1 WinMerge 2.14.0 是截至 2017 年 6 月的最新稳定版本,于 2013 年 2 月 3 日发布。
2 Merge7z DllBuild 0028 是 2015-09 的最新版本,于 2010-12-28 发布。
3 DLL 是Merge7z DllBuild 0028Merge7z920.dllMerge7z920U.dll的 7-Zip 9.20,WinMerge 可执行文件的路径可能是C:\Program Files (x86)\WinMerge\WinMergeU.exe. “U”代表 DLL 和可执行文件名称中的 Unicode。对于WinMergeU.exe, onlyMerge7z920U.dll是必需的,但最好两者兼而有之,不必在意。

于 2015-09-12T09:35:01.370 回答
3

WinMerge 常见问题解答 第 6.4 节

WinMerge 可以打开具有非标准文件扩展名的存档文件吗?(例如 .jar 文件作为 zip 文件)

是:单击选项按钮(或单击编辑 → 选项)。在存档支持页面中,启用从文件签名中检测存档类型选项。

于 2013-06-20T08:32:49.100 回答
2

如果您想比较具有文件类型 *.jar、*.war、*.ear..etc 的不同目录,一个不错的选择是比较软件http://www.scootersoftware.com/。不是免费的,但您有一个试用选项来证明它。它是多平台的 linux、windows 或 macosx。

于 2015-05-13T07:46:09.480 回答