13. Plugins

Plugins are extra-features for WinMerge. They are not included in the basic version because they interest few users, or because they do not fit in WinMerge architecture.

Each plugin:

13.1. Three categories of plugins

"Plugins" is a generic name for extra-feature dll or scriptlets. Plugins features are spread over three categories:

13.1.1. Editor complement

Operate custom operations on the currently selected text from the active editor pane.

Example plugin: editor addin.sct (Turn the selection to UPPER CASE or lower case.)

13.1.2. Unpacker - Transform a file to a text format

The plugin transform a file in a viewable format (for example, decompress a file). The original file is not changed. A temporary transformed file is created and loaded in WinMerge.

Sometimes the transformed file can be packed back. (See the plugin details to know if it supports packing back.) Then you may merge and save the transformed file. The packing is done automatically in this case. To avoid problems, you are proposed to change the filename when saving a changed file.

[Note] Note

When you compare folders, WinMerge doesn't need to display the files, but the diffing process can give a different result when you compare compressed and not compressed files (for example, uncompressed files may be identical, but the compressed files may differ if they include the date of creation). WinMerge applies the unpacker in all situations, and you are sure to have the same result when you compare folder, or when you merge two versions of a file.

Example plugin: DisplayXMLFiles.dll (Display XML files nicely, by consistently inserting tabs and linebreaks.)

13.1.3. Prediffer - Preprocess files to hide some differences

The plugin is not apply to the files displayed in the editor. It is applied only to temporary copies of the files, and this copies are then scanned to create the difference list.

Example plugin: IgnoreColumns.dll (Ignore the differences inside given columns, while displaying the characters in these columns.)

13.2. Select and apply a plugin

13.2.1. "Suggested plugin" and "Automatic mode"

Each plugin specifies a list of file extensions (see plugins details for more info). When the file extension, either from the left or from the right file, matches the plugin list, the plugin is called "a suggested plugin".

When "Automatic mode" is on, WinMerge searches for a suggested plugin and applies it if it is avaialble. When two suggested plugins are available for a file, WinMerge applies the first one only (alphabetical order).

[Note] Note

"Automatic Unpacking" and "Auto prediffer" are two separate options. There is no option for editor complements.

13.2.2. Editor complement in folder view

Not available

13.2.3. Editor complement in editor view

Access list from Edit->Scripts->... in the main menu.

13.2.4. Unpacker in folder view

Check Plugins->Automatic Unpacking in the main menu. You need to update the results (F5). Each file is loaded again with its suggested unpacker and compared.

13.2.5. Unpacker in editor view

  1. Open dialog: Select the two files first and then press the Select button right from the field "Unpacker". WinMerge displays the standard dialog for unpacker selection. Use the top combobox to select the plugin. Two generic choices "None" and "Automatic" are also available.

  2. From the folder view when Plugins->Automatic Unpacking is checked: Just double click to open the file. The suggested plugin used during the folder comparison is used to load the file in the editor.

  3. From the folder view, always: Select one file, then main menu Plugins->Edit with Unpacker. WinMerge displays the dialog for unpacker selection. Select an unpacker and press OK, WinMerge opens the editor view and applies this unpacker to load the file. This plugin is forgotten when you close the editor view.

13.2.6. Prediffer in folder view

When the files are selected, right-click to open the context menu. Follow Plugin Settings->Prediffer Settings and select "Auto prediffer" or "No prediffer". Refresh the view (F5) to update the results.

[Note] Note

"Auto prediffer" is a per-file option. Some files in the same folder can be in mode "No prediffer" and some in mode "Auto prediffer". When you change folder during a non-recursive compare, the mode is always reset to "No prediffer".

13.2.7. Prediffer in editor view

  1. From the folder view when "Auto prediffer" is checked for a file: Just double click to open the file. The plugin used during the folder comparison is used in the editor before the diff algorithm.

  2. During an editor session, access prediffer lists with menu Plugins->Prediffer->...: The active prediffer is checked. Suggested plugins are indicated first above the not-suggested ones. The files are compared again after the selection, you don't need to rescan.

13.3. Available plugins

13.3.1. CompareMSExcelFiles.dll

Displays the text content of a Microsoft® Excel file, stripping away all formatting and embedded objects.

Categorie: Unpacker
File filter: *.xls
Packing: No
Requirement: Microsoft® Excel, Visual Basic runtime library

13.3.2. CompareMSWordFiles.dll

Displays the text content of a Microsoft® Word file, stripping away all formatting and embedded objects.

Categorie: Unpacker
File filter: *.doc
Packing: No
Requirement: Microsoft® Word, Visual Basic runtime library

13.3.3. DisplayBinaryFiles.dll

Use this plugin to display the differences between two binary files.

This is not a hex editor, but simply a way to display files which have reasonable lines (carriage returns), per WinMerge's textual display style. This can help for detecting changed strings in binaries.

[Note] Note

Replaces all 0 with 0x20 (spaces).

This is a lossy operation, which means that the files can only be displayed; they cannot be saved, so there is no point in trying to merge. If you really want to save the files, you should look at the plugin EditBinaryFiles.dll.

Categorie: Unpacker
File filter: *.exe, *.dll, *.ocx, *.doc, *.xls
Packing: No

13.3.4. DisplayXMLFiles.dll

This plugin display XML files nicely, by consistently inserting tabs and linebreaks. This is to fix XML files which do not have line returns in convenient locations.

Categorie: Unpacker
File filter: *.xml
Packing: No

13.3.5. EditBinaryFiles.dll

Allow editing of binary files (if line based), using escape scheme for bytes under 0x20.

Categorie: Unpacker
File filter: *.exe, *.dll, *.ocx, *.doc, *.xls
Packing: Yes

13.3.6. editor addin.sct

Add two functions to the Edit->Scripts menu:

  • MakeUpper convert the selection to UPPER CASE.
  • MakeLower convert the selection to lower case.

Categorie: Editor complement

13.3.7. IgnoreColumns.dll

The plugin ignore the characters at specified columns. It does not support files with tabulations (no crash, but all tabs will be treated as a normal character). The first column has number 1.

For the parameters, you just need to rename the dll with the following syntax:

  • Delimiters between ranges: _ or ,
  • Delimiters between min and max: anything else
  • Min and max are included.
  • When max = min, max may be omitted.

Example 6. IgnoreColumns.dll syntax

IgnoreColumns _ 3 _ 10 - 20 _ 32 - 33.dll
Ignore all characters at column 3, and in columns 10 to 20, and 32 to 33.
IgnoreColumns_1,30 to 40.dll
Ignore all the characters in column 1, and in columns 30 to 40.

Categorie: Prediffer
File filter: *.txt

13.3.8. IgnoreCommentsC.dll

The plugin ignores comments (//... and /* ... */) in C, C++, PHP and JavaScript files.

Categorie: Prediffer
File filter: *.cpp, *.cxx, *.h, *.hxx, *.c, *.php, *.js

13.3.9. IgnoreFieldsComma.dll

The plugin is for files with fields and comma as delimiters (CSV files for example). It ignore the characters in the specified fields. First field has number 1.

Modify the filename to specify the fields. See IgnoreColumns.dll for the syntax.

Categorie: Prediffer
File filter: *.csv

13.3.10. IgnoreFieldsTab.dll

The plugin is for files with fields and tabulations as delimiters (Excel files saved in format *.txt for example). It ignore the characters in the specified fields. First field has number 1.

Modify the filename to specify the fields. See IgnoreColumns.dll for the syntax.

Categorie: Prediffer
File filter: *.txt

13.3.11. IgnoreLeadingLineNumbers.dll

This plugin ignores the leading line numbers in text files (for example NC and BASIC files).

Categorie: Prediffer
File filter: *.nc

13.3.12. insert datetime.sct

Add two functions to the Edit->Scripts menu:

  • InsertDate insert date in the current locale format.
  • InsertTime insert time in the current locale format.

Categorie: Editor complement

13.3.13. RCLocalizationHelper.dll, RCLocalizationHelperU.dll

The plugin preprocesses RC files by stripping out localized strings, to enable comparing differnt language versions of the same RC file and ignoring the translations.

RCLocalizationHelperU.dll is the Unicode version.

Categorie: Prediffer
File filter: *.rc

13.3.14. UnpackDFM.dll

This plugin allows WinMerge to compare and merge Delphi's binary DFM files. It is written in and for Borland® Delphi 4.

Categorie: Unpacker
File filter: *.dfm
Packing: Yes
Requirement: Runtime library vcl40.bpl, which is part of the Delphi 4 setup.

13.3.15. WatchBeginningOfLog.dll, WatchEndOfLog.dll

For long LOG files, the user is often interested only in the first lines or in the last lines.

  • WatchBeginningOfLog.dll truncates the files to the first 1/10th.
  • WatchEndOfLog.dll truncates the files to the first 1/10th.

Categorie: Unpacker
File filter: *.log
Packing: No

Developers may find information and code of examples in the source package, under the folder "Plugins".

13.4. Requirements

13.4.1. Windows Script Host

Some editor complements need this optional component from Microsoft®.

If the list of editor complements does not present all editor plugins, this component is probably missing. You can check easily. WinMerge informs you with a comment at the bottom of the list. You may install WSH on any version of Windows (need IE 4.0). Download it from MSDN Library.

13.4.2. Visual Basic runtime library

Some plugins require Visual Basic runtime library to work.

You can download the required file msvbvm60.dll or use the Run-Time Redistribution Pack from Microsoft®. If you don't need the plugin, you can safely remove it.