1 <?xml version="1.0" encoding="UTF-8"?>
3 <title>Plugins<indexterm>
4 <primary>plugins</primary>
7 <para>WinMerge plugins are custom dlls or scriptlets, written in the COM API,
8 that preprocess data before a comparison. For example, you can use a plugin to
9 extract text data from MS Word files for WinMerge to compare.</para>
11 <para>Each plugin is:<indexterm>
12 <primary>installing plugins</primary>
17 <para>A single dll or a scriptlet (<filename
18 class="extension">sct</filename>) file</para>
22 <para>Installed in the <filename class="directory">MergePlugins</filename>
23 subfolder. A number of plugins can be installed for you by WinMerge.</para>
27 <para>Easy to install: To install a plugin that is not included in the
28 WinMerge installation, just copy the plugin file to <filename
29 class="directory">MergePlugins</filename>. The plugin is available the
30 next time you open WinMerge. You can find more plugins on the web, written
31 by other developers.</para>
36 <title>Plugin Types</title>
38 <para>Plugins are grouped into three main categories:</para>
42 <term>Editor complement<indexterm>
43 <primary>editor complement plugins</primary>
47 <para>This type of plugin performs custom operations on selected text
48 in the active editor (File pane) of the File Compare window.</para>
53 <term>Unpacker: transform a file to a text format<indexterm>
54 <primary>unpacker plugins</primary>
58 <para>This type of plugin transforms a compressed file to a viewable
59 format by decompressing it. The original file is not changed: a
60 temporary transformed file is created and loaded in WinMerge.</para>
62 <para>Unpacker plugins operate on entire files, not to selected text
63 or diffs within files. Therefore, they are available only when you
64 launch file comparisons, from either the Folder Compare window or the
65 Select Files or Folders dialog. Unpacker plugins are not available in
66 the File Compare window.</para>
68 <para>Sometimes the unpacked file can be repacked (see the details in
69 <xref linkend="Plugins_available" /> to check whether a plugin
70 supports repacking). Then, you can merge and save the transformed
71 file. The packing is done automatically in this case. To be safe, we
72 suggest that you rename the transformed file when you save it.</para>
75 <para>When you compare folders, WinMerge can give different results
76 for compressed and uncompressed files. For example, files that are
77 identical when uncompressed might be different if they include the
78 creation date. WinMerge applies the unpacker in all situations, and
79 you are sure to have the same result when you compare a folder, or
80 when you merge two versions of a file.</para>
83 <para>Example plugin: <xref linkend="CompareMSExcelFiles" />
84 displays the text contents of a
85 <trademark class="registered">Microsoft</trademark>
86 <application>Excel</application> file.</para>
91 <term>Prediffer: preprocess files to hide some differences<indexterm>
92 <primary>prediffer plugins</primary>
96 <para>This type of plugin does not operate on the source files
97 displayed in the Compare window. It operates instead on temporary
98 copies of the files, and the copies are then scanned to create the
99 difference list.</para>
101 <para>Example plugin: <xref linkend="IgnoreColumns" /> ignores the
102 differences inside specified columns, while displaying the characters
103 in these columns.</para>
110 <title>Suggested plugins and automatic modes</title>
112 <para>How is WinMerge able to apply the right plugin for a given file? Each
113 plugin specifies a list of file extensions (also listed in each plugin's
114 <xref linkend="Plugins_available" /> section, under <citetitle>File
115 filter</citetitle>). The extensions are used to associate one or more file
116 types with the plugin: when a compared file's extension matches an extension
117 in the plugin's list, the plugin is considered to be a <firstterm>suggested
118 plugin. </firstterm></para>
120 <para>There are separate WinMerge options for the unpacking and prediffer
121 types, described later in this topic, that enable you to apply the plugins
122 either manually or automatically. There is no automatic mode for editor
123 complement plugins.</para>
125 <para>When you apply plugins to a selected file using automatic mode,
126 WinMerge searches its list of suggested plugins for that file type, and
127 applies the first plugin whose name matches. The search is performed in
128 alphabetical order, so if there are multiple suggested plugins for a file
129 type, only the first one found is applied.</para>
133 <title>Applying plugins</title>
135 <para>The following subsections describe how to apply each type of plugin.
136 The methods are different for each type of plugin, and also vary depending
137 on whether you are comparing folders or files.</para>
140 <title>Applying editor complement plugins in the File Compare
143 <para>With your cursor in either File pane of the File Compare window,
145 <guimenu>Plugins</guimenu>
147 <guisubmenu>Scripts</guisubmenu>
148 </menuchoice> and choose one of these functions:</para>
152 <para><function>MakeUpper</function></para>
156 <para><function>MakeLower</function></para>
160 <para><function>SortAscending</function></para>
164 <para><function>SortDescending</function></para>
168 <para><function>ExecFilterCommand</function></para>
172 <para><function>InsertDate</function></para>
176 <para><function>InsertTime</function></para>
180 <para>The functions are contributed to the
181 <guisubmenu>Scripts</guisubmenu> menu by the <xref
182 linkend="EditorAddin" /> and <xref linkend="Plugins_datetime" />
186 <para>Editor complement plugins are not available in the Folder Compare
192 <title>Applying unpacker plugins in the Folder Compare window</title>
194 <para>Before applying unpacker plugins, you can set its mode to either
195 automatic or manual mode.</para>
199 <para>To set automatic mode for this type of plugin, click <menuchoice>
200 <guimenu>Plugins</guimenu>
202 <guimenuitem>Automatic Unpacking</guimenuitem>
203 </menuchoice>.</para>
207 <para>To set manual mode, click <menuchoice>
208 <guimenu>Plugins</guimenu>
210 <guimenuitem>Manual Unpacking</guimenuitem>
211 </menuchoice>.</para>
215 <para>Remember to click <keycap>F5</keycap> to reload the Folder Compare
216 window using the new setting.</para>
219 <title>Using automatic mode</title>
221 <para>To apply plugins when automatic unpacking is set, simply launch a
222 compare operation on a file in the Folder Compare window. If the file's
223 type suggested unpacker plugin (if any) preprocesses the file before
224 WinMerge opens it in the File Compare window.</para>
226 <para>For example, suppose you right-click an MS Word
227 <filename>doc</filename> file and choose
228 <guimenuitem>Compare</guimenuitem> (also assume that the <xref
229 linkend="Plugins_msword" /> plugin is available). WinMerge converts the
230 doc file (or rather, a copy of it ) to a plain text file and opens it in
231 the File Compare window.</para>
235 <title>Using manual mode</title>
237 <para>Manual mode enables you to choose a different unpacker plugin than
238 the one that is selected for you in automatic mode. You can also launch
239 the compare using no plugin.</para>
241 <para>To apply plugins when manual unpacking is set:</para>
245 <para>Select the file you want to compare.</para>
249 <para>Click <menuchoice>
250 <guimenu>Plugins</guimenu>
252 <guimenuitem>Edit with Unpacker</guimenuitem>
253 </menuchoice>.</para>
255 <para>This menu item is enabled only if the selected file's type is
256 supported by an available unpacking plugin.</para>
260 <para>In the Select Unpacker dialog:</para>
262 <xi:include href="select_unpacker.xml"
263 xmlns:xi="http://www.w3.org/2001/XInclude"
264 xpointer="element(select-unpacker-proc)" />
268 <para>Click <guibutton>OK</guibutton> to close the Select Unpacker
269 dialog and launch the file comparison.</para>
276 <title>Applying unpacker plugins in the Select Files or Folders
279 <para>You can use the Select Unpacker dialog to apply a plugin when you
280 launch a file comparison from the Select Files or Folders dialog. See
281 <xref linkend="Open_paths_unpacker" /> for details.</para>
285 <title>Applying prediffer plugins in the Folder Compare window</title>
287 <para>With prediffer plugins, you set the mode (<firstterm>Auto
288 prediffer</firstterm> or <firstterm>No prediffer</firstterm>) for
289 individual files. (Contrast this with unpacker plugins, where you set the
290 mode for all files.) That is, some files in the same folder have different
291 prediffer modes.</para>
293 <para>To set the mode for one or more files in the Folder Compare window,
294 right-click the files and choose <menuchoice>
295 <guimenu>Plugin Settings</guimenu>
297 <guisubmenu>Prediffer Settings</guisubmenu>
298 </menuchoice>, then choose one of the submenu options:</para>
302 <para><guisubmenu>Auto Prediffer</guisubmenu> selects the first
303 prediffer plugin available for the file type.</para>
307 <para><guisubmenu>No prediffer</guisubmenu> means that no prediffer
308 plugin is used.</para>
312 <para>Click <keycap>F5</keycap> to update the window.</para>
315 <para>When you open a subfolder during a non-recursive compare, the mode
316 is always reset to <guimenuitem>No prediffer</guimenuitem>.</para>
319 <para>When you open a file from the Folder Compare window, your prediffer
320 setting for that file is applied before the File Compare window is
325 <title>Applying prediffer plugins in the File Compare window</title>
327 <para>In the File Compare window, you can apply a prediffer plugin by
328 clicking <menuchoice>
329 <guimenu>Plugins</guimenu>
331 <guisubmenu>Prediffer</guisubmenu>
332 </menuchoice> and choosing one of the plugins in the list. Suggested
333 plugins are indicated at the top of the list. The files are compared again
334 after the plugin is applied, so you don't need to rescan the files.</para>
338 <section id="Plugins_available">
339 <title>Available plugins<indexterm>
340 <primary>Visual Basic dlls for plugins</primary>
341 </indexterm><indexterm>
342 <primary>plugins</primary>
344 <secondary>Visual Basic dlls</secondary>
347 <section id="CompareMSExcelFiles">
348 <title><filename>CompareMSExcelFiles.sct<indexterm>
349 <primary>CompareMSExcelFiles.sct plugin file</primary>
350 </indexterm></filename></title>
352 <para>Displays the text contents of a <trademark
353 class="registered">Microsoft</trademark> <application>Excel</application>
354 file, stripping away all formatting and embedded objects.</para>
356 <para><segmentedlist>
357 <segtitle>Category</segtitle>
359 <segtitle>File filter</segtitle>
361 <segtitle>Packing</segtitle>
363 <segtitle>Settings dialog support</segtitle>
365 <segtitle>Dependency</segtitle>
370 <seg><filename class="extension">*.xls</filename>, <filename
371 class="extension">*.xlsx</filename>, <filename
372 class="extension">*.xlsm</filename>, <filename
373 class="extension">*.xlsb</filename>, <filename
374 class="extension">*.xla</filename>, <filename
375 class="extension">*.xlax</filename>, <filename
376 class="extension">*.xltx</filename>, <filename
377 class="extension">*.xltm</filename></seg>
383 <seg><trademark class="registered">Microsoft</trademark>
384 <application>Excel</application></seg>
386 </segmentedlist></para>
389 <section id="Plugins_msword">
390 <title><filename>CompareMSWordFiles.sct<indexterm>
391 <primary>CompareMSWordFiles.sct plugin file</primary>
392 </indexterm></filename></title>
394 <para>Displays the text content of a <trademark
395 class="registered">Microsoft</trademark> <application>Word</application>
396 file, stripping away all formatting and embedded objects.</para>
398 <para><segmentedlist>
399 <segtitle>Category</segtitle>
401 <segtitle>File filter</segtitle>
403 <segtitle>Packing</segtitle>
405 <segtitle>Settings dialog support</segtitle>
407 <segtitle>Dependency</segtitle>
412 <seg><filename class="extension">*.doc</filename>, <filename
413 class="extension">*.docx</filename>, <filename
414 class="extension">*.docm</filename>, <filename
415 class="extension">*.dot</filename>, <filename
416 class="extension">*.dotx</filename>, <filename
417 class="extension">*.dotm</filename></seg>
423 <seg><trademark class="registered">Microsoft</trademark>
424 <application>Word</application></seg>
426 </segmentedlist></para>
429 <section id="Plugins_powerpnt">
430 <title><filename>CompareMSPowerPointFiles.sct<indexterm>
431 <primary>CompareMSPowerPointFiles.sct plugin file</primary>
432 </indexterm></filename></title>
434 <para>Displays the text content of a <trademark
435 class="registered">Microsoft</trademark> <application>PowerPoint</application>
436 file, stripping away all formatting and embedded objects.</para>
438 <para><segmentedlist>
439 <segtitle>Category</segtitle>
441 <segtitle>File filter</segtitle>
443 <segtitle>Packing</segtitle>
445 <segtitle>Settings dialog support</segtitle>
447 <segtitle>Dependency</segtitle>
452 <seg><filename class="extension">*.ppt</filename>, <filename
453 class="extension">*.pptx</filename>, <filename
454 class="extension">*.pptm</filename>, <filename
455 class="extension">*.ppa</filename>, <filename
456 class="extension">*.ppam</filename>, <filename
457 class="extension">*.pot</filename>, <filename
458 class="extension">*.potx</filename>, <filename
459 class="extension">*.potm</filename></seg>
465 <seg><trademark class="registered">Microsoft</trademark>
466 <application>PowerPoint</application></seg>
468 </segmentedlist></para>
471 <section id="Plugins_visio">
472 <title><filename>CompareMSVisioFiles.sct<indexterm>
473 <primary>CompareMSVisioFiles.sct plugin file</primary>
474 </indexterm></filename></title>
476 <para>Displays the text content of a <trademark
477 class="registered">Microsoft</trademark> <application>Visio</application>
478 file, stripping away all formatting and embedded objects.</para>
480 <para><segmentedlist>
481 <segtitle>Category</segtitle>
483 <segtitle>File filter</segtitle>
485 <segtitle>Packing</segtitle>
487 <segtitle>Settings dialog support</segtitle>
489 <segtitle>Dependency</segtitle>
494 <seg><filename class="extension">*.vsd</filename>, <filename
495 class="extension">*.vsdx</filename>, <filename
496 class="extension">*.vsdm</filename>, <filename
497 class="extension">*.vss</filename>, <filename
498 class="extension">*.vssx</filename>, <filename
499 class="extension">*.vssm</filename>, <filename
500 class="extension">*.vst</filename>, <filename
501 class="extension">*.vstx</filename>, <filename
502 class="extension">*.vstm</filename></seg>
508 <seg><trademark class="registered">Microsoft</trademark>
509 <application>Visio</application></seg>
511 </segmentedlist></para>
514 <section id="EditorAddin">
515 <title><filename>editor addin.sct<indexterm>
516 <primary>editor addin.sct plugin file</primary>
517 </indexterm></filename></title>
519 <para>Adds five functions to the <menuchoice>
520 <guimenu>Plugins</guimenu>
522 <guisubmenu>Scripts</guisubmenu>
523 </menuchoice> menu:</para>
527 <simpara><guimenuitem>MakeUpper</guimenuitem> convert the selection to
528 UPPER CASE.</simpara>
532 <simpara><guimenuitem>MakeLower</guimenuitem> convert the selection to
533 lower case.</simpara>
537 <simpara><guimenuitem>SortAscending</guimenuitem> sort the selection
538 in ascending order.</simpara>
542 <simpara><guimenuitem>SortDescending</guimenuitem> sort the selection
543 in descending order.</simpara>
547 <simpara><guimenuitem>ExecFilterCommand</guimenuitem> replace the selection
548 with the output of the specified filter command.</simpara>
552 <para><segmentedlist>
553 <segtitle>Category</segtitle>
554 <segtitle>Settings dialog support</segtitle>
557 <seg>Editor complement</seg>
560 </segmentedlist></para>
563 <section id="IgnoreColumns">
564 <title><filename>IgnoreColumns.dll<indexterm>
565 <primary>IgnoreColumns.dll plugin file</primary>
566 </indexterm></filename></title>
568 <para>This plugin ignores characters at specified columns. The first
569 column is number 1.</para>
571 <para>Note that this plugin does not support files with tabs: the plugin
572 does not fail, but all tabs are be treated as normal characters.</para>
574 <para>To specify columns, use plugin settings dialog or rename the <filename>dll</filename> using
575 following fields as parameters:</para>
579 <simpara>Delimiters between ranges: _ or ,</simpara>
583 <simpara>Delimiters between min and max: <emphasis>anything
584 else</emphasis></simpara>
588 <simpara>Min and max are included.</simpara>
592 <simpara>When max = min, max can be omitted.</simpara>
597 <title><filename>IgnoreColumns.dll</filename> examples</title>
601 <term><filename>IgnoreColumns _ 3 _ 10 - 20 _ 32 -
602 33.dll</filename></term>
605 <simpara>Ignore all characters at column 3, and in columns 10 to
606 20, and 32 to 33.</simpara>
611 <term><filename>IgnoreColumns_1,30 to 40.dll</filename></term>
614 <simpara>Ignore all the characters in column 1, and in columns 30
621 <para><segmentedlist>
622 <segtitle>Category</segtitle>
624 <segtitle>File filter</segtitle>
626 <segtitle>Settings dialog support</segtitle>
631 <seg><filename class="extension">*.txt</filename></seg>
635 </segmentedlist></para>
639 <title><filename>IgnoreCommentsC.dll<indexterm>
640 <primary>IgnoreCommentsC.dll plugin file</primary>
641 </indexterm></filename></title>
643 <para>The plugin ignores comments within<constant> //</constant>... and
644 <constant>/*</constant> ... <constant>*/</constant> delimiters in C, C++,
645 PHP and JavaScript files.</para>
647 <para><segmentedlist>
648 <segtitle>Category</segtitle>
650 <segtitle>File filter</segtitle>
652 <segtitle>Settings dialog support</segtitle>
657 <seg><filename class="extension">*.cpp</filename>, <filename
658 class="extension">*.cxx</filename>, <filename
659 class="extension">*.h</filename>, <filename
660 class="extension">*.hxx</filename>, <filename
661 class="extension">*.c</filename>, <filename
662 class="extension">*.php</filename>, <filename
663 class="extension">*.js</filename>, <filename
664 class="extension">*.cs</filename>, <filename
665 class="extension">*.ts</filename></seg>
669 </segmentedlist></para>
673 <title><filename>IgnoreFieldsComma.dll<indexterm>
674 <primary>IgnoreFieldsComma.dll plugin file</primary>
675 </indexterm></filename></title>
677 <para>This plugin is for files with fields and commas as delimiters (CSV
678 files, for example). It ignores the delimiter characters. The first field
681 <para>To specify the delimiters, use plugin settings dialog or rename the <filename>dll</filename> using
682 the same parameter fields used for <xref
683 linkend="IgnoreColumns" />.</para>
685 <para><segmentedlist>
686 <segtitle>Category</segtitle>
688 <segtitle>File filter</segtitle>
690 <segtitle>Settings dialog support</segtitle>
695 <seg><filename class="extension">*.csv</filename></seg>
699 </segmentedlist></para>
703 <title><filename>IgnoreFieldsTab.dll<indexterm>
704 <primary>IgnoreFieldsTab.dll plugin file</primary>
705 </indexterm></filename></title>
707 <para>This plugin is for files that use fields and tabs as delimiters
708 (<application>for example, Excel</application> files saved in the <filename
709 class="extension">*.txt</filename> format). It ignores the delimiter
710 characters. The first field is number 1.</para>
712 <para>To specify the delimiters, use plugin settings dialog or rename the <filename>dll</filename> using
713 the same parameter fields used for <xref
714 linkend="IgnoreColumns" />.</para>
716 <para><segmentedlist>
717 <segtitle>Category</segtitle>
719 <segtitle>File filter</segtitle>
721 <segtitle>Settings dialog support</segtitle>
726 <seg><filename class="extension">*.txt</filename></seg>
730 </segmentedlist></para>
734 <title><filename>IgnoreLeadingLineNumbers.dll<indexterm>
735 <primary>IgnoreLeadingLineNumbers.dll plugin file</primary>
736 </indexterm></filename></title>
738 <para>This plugin ignores the leading line numbers in text files (for
739 example, NC and BASIC files).</para>
741 <para><segmentedlist>
742 <segtitle>Category</segtitle>
744 <segtitle>File filter</segtitle>
746 <segtitle>Settings dialog support</segtitle>
748 <segtitle>Requirement</segtitle>
753 <seg><filename class="extension">*.nc</filename></seg>
757 <seg><xref linkend="MSVBVM60" /></seg>
759 </segmentedlist></para>
762 <section id="Plugins_datetime">
763 <title><filename>insert datetime.sct<indexterm>
764 <primary>insert datetime.sct plugin file</primary>
765 </indexterm></filename></title>
767 <para>Adds two functions to the <menuchoice>
768 <guimenu>Plugins</guimenu>
770 <guisubmenu>Scripts</guisubmenu>
771 </menuchoice> menu:</para>
775 <simpara><guimenuitem>InsertDate</guimenuitem> insert date in the
776 current locale format.</simpara>
780 <simpara><guimenuitem>InsertTime</guimenuitem> insert time in the
781 current locale format.</simpara>
785 <para><segmentedlist>
786 <segtitle>Category</segtitle>
788 <segtitle>Settings dialog support</segtitle>
791 <seg>Editor complement</seg>
795 </segmentedlist></para>
800 <title>Requirements<indexterm>
801 <primary>plugins</primary>
803 <secondary>Windows Script Host requirement</secondary>
807 <title>Windows Script Host</title>
809 <para>Some editor complement plugins require this optional component from
810 <trademark class="registered">Microsoft</trademark>.</para>
812 <para>It should already be included in your version of Windows,
813 unless you use some really old pre Windows XP version.</para>
816 <section id="MSVBVM60">
817 <title><application>Visual Basic</application> runtime library<indexterm>
818 <primary>Visual Basic dlls for plugins</primary>
819 </indexterm><indexterm>
820 <primary>plugins</primary>
822 <secondary>Visual Basic dlls</secondary>
823 </indexterm><indexterm>
824 <primary>msvbvm60.dll plugin file</primary>
825 </indexterm><indexterm>
826 <primary>Run-Time Redistribution Pack, for Visual Basic
830 <para>Some plugins require <application>the Visual Basic</application>
831 runtime library to work.</para>
833 <para>You can use the <ulink
834 url="https://www.microsoft.com/en-us/download/details.aspx?id=24417">Run-Time
835 Redistribution Pack</ulink> from <trademark
836 class="registered">Microsoft</trademark>. If you don't need the plugin,
837 you can safely remove it.</para>