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>Make Uppercase</function></para>
156 <para><function>Make Lowercase</function></para>
160 <para><function>Sort Lines Ascending</function></para>
164 <para><function>Sort Lines Descending</function></para>
168 <para><function>Apply Filter Command...</function></para>
172 <para><function>Insert Date</function></para>
176 <para><function>Insert Time</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<indexterm>
349 <primary>CompareMSExcelFiles 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>Plugin argument</segtitle>
363 <segtitle>Packing</segtitle>
365 <segtitle>Settings dialog support</segtitle>
367 <segtitle>Dependency</segtitle>
372 <seg><filename class="extension">*.xls</filename>, <filename
373 class="extension">*.xlsx</filename>, <filename
374 class="extension">*.xlsm</filename>, <filename
375 class="extension">*.xlsb</filename>, <filename
376 class="extension">*.xla</filename>, <filename
377 class="extension">*.xlax</filename>, <filename
378 class="extension">*.xltx</filename>, <filename
379 class="extension">*.xltm</filename></seg>
387 <seg><trademark class="registered">Microsoft</trademark>
388 <application>Excel</application></seg>
390 </segmentedlist></para>
393 <section id="Plugins_powerpnt">
394 <title><filename>CompareMSPowerPointFiles<indexterm>
395 <primary>CompareMSPowerPointFiles plugin file</primary>
396 </indexterm></filename></title>
398 <para>Displays the text content of a <trademark
399 class="registered">Microsoft</trademark> <application>PowerPoint</application>
400 file, stripping away all formatting and embedded objects.</para>
402 <para><segmentedlist>
403 <segtitle>Category</segtitle>
405 <segtitle>File filter</segtitle>
407 <segtitle>Plugin argument</segtitle>
409 <segtitle>Packing</segtitle>
411 <segtitle>Settings dialog support</segtitle>
413 <segtitle>Dependency</segtitle>
418 <seg><filename class="extension">*.ppt</filename>, <filename
419 class="extension">*.pptx</filename>, <filename
420 class="extension">*.pptm</filename>, <filename
421 class="extension">*.ppa</filename>, <filename
422 class="extension">*.ppam</filename>, <filename
423 class="extension">*.pot</filename>, <filename
424 class="extension">*.potx</filename>, <filename
425 class="extension">*.potm</filename></seg>
433 <seg><trademark class="registered">Microsoft</trademark>
434 <application>PowerPoint</application></seg>
436 </segmentedlist></para>
439 <section id="Plugins_visio">
440 <title><filename>CompareMSVisioFiles<indexterm>
441 <primary>CompareMSVisioFiles plugin file</primary>
442 </indexterm></filename></title>
444 <para>Displays the text content of a <trademark
445 class="registered">Microsoft</trademark> <application>Visio</application>
446 file, stripping away all formatting and embedded objects.</para>
448 <para><segmentedlist>
449 <segtitle>Category</segtitle>
451 <segtitle>File filter</segtitle>
453 <segtitle>Plugin argument</segtitle>
455 <segtitle>Packing</segtitle>
457 <segtitle>Settings dialog support</segtitle>
459 <segtitle>Dependency</segtitle>
464 <seg><filename class="extension">*.vsd</filename>, <filename
465 class="extension">*.vsdx</filename>, <filename
466 class="extension">*.vsdm</filename>, <filename
467 class="extension">*.vss</filename>, <filename
468 class="extension">*.vssx</filename>, <filename
469 class="extension">*.vssm</filename>, <filename
470 class="extension">*.vst</filename>, <filename
471 class="extension">*.vstx</filename>, <filename
472 class="extension">*.vstm</filename></seg>
480 <seg><trademark class="registered">Microsoft</trademark>
481 <application>Visio</application></seg>
483 </segmentedlist></para>
486 <section id="Plugins_msword">
487 <title><filename>CompareMSWordFiles<indexterm>
488 <primary>CompareMSWordFiles plugin file</primary>
489 </indexterm></filename></title>
491 <para>Displays the text content of a <trademark
492 class="registered">Microsoft</trademark> <application>Word</application>
493 file, stripping away all formatting and embedded objects.</para>
495 <para><segmentedlist>
496 <segtitle>Category</segtitle>
498 <segtitle>File filter</segtitle>
500 <segtitle>Plugin argument</segtitle>
502 <segtitle>Packing</segtitle>
504 <segtitle>Settings dialog support</segtitle>
506 <segtitle>Dependency</segtitle>
511 <seg><filename class="extension">*.doc</filename>, <filename
512 class="extension">*.docx</filename>, <filename
513 class="extension">*.docm</filename>, <filename
514 class="extension">*.dot</filename>, <filename
515 class="extension">*.dotx</filename>, <filename
516 class="extension">*.dotm</filename></seg>
524 <seg><trademark class="registered">Microsoft</trademark>
525 <application>Word</application></seg>
527 </segmentedlist></para>
530 <section id="IgnoreColumns">
531 <title><filename>IgnoreColumns<indexterm>
532 <primary>IgnoreColumns plugin file</primary>
533 </indexterm></filename></title>
535 <para>This plugin ignores characters at specified columns. The first
536 column is number 1.</para>
538 <para>Note that this plugin does not support files with tabs: the plugin
539 does not fail, but all tabs are be treated as normal characters.</para>
541 <para>To specify columns, use plugin settings dialog or rename the <filename>dll</filename> using
542 following fields as parameters:</para>
546 <simpara>Delimiters between ranges: _ or ,</simpara>
550 <simpara>Delimiters between min and max: <emphasis>anything
551 else</emphasis></simpara>
555 <simpara>Min and max are included.</simpara>
559 <simpara>When max = min, max can be omitted.</simpara>
564 <title><filename>IgnoreColumns</filename> examples</title>
568 <term><filename>IgnoreColumns _ 3 _ 10 - 20 _ 32 -
569 33.dll</filename></term>
572 <simpara>Ignore all characters at column 3, and in columns 10 to
573 20, and 32 to 33.</simpara>
578 <term><filename>IgnoreColumns_1,30 to 40.dll</filename></term>
581 <simpara>Ignore all the characters in column 1, and in columns 30
588 <para><segmentedlist>
589 <segtitle>Category</segtitle>
591 <segtitle>File filter</segtitle>
593 <segtitle>Plugin argument</segtitle>
595 <segtitle>Settings dialog support</segtitle>
600 <seg><filename class="extension">*.txt</filename></seg>
604 </segmentedlist></para>
608 <title><filename>IgnoreCommentsC<indexterm>
609 <primary>IgnoreCommentsC plugin file</primary>
610 </indexterm></filename></title>
612 <para>The plugin ignores comments within<constant> //</constant>... and
613 <constant>/*</constant> ... <constant>*/</constant> delimiters in C, C++,
614 PHP and JavaScript files.</para>
616 <para><segmentedlist>
617 <segtitle>Category</segtitle>
619 <segtitle>File filter</segtitle>
621 <segtitle>Plugin argument</segtitle>
623 <segtitle>Settings dialog support</segtitle>
628 <seg><filename class="extension">*.cpp</filename>, <filename
629 class="extension">*.cxx</filename>, <filename
630 class="extension">*.h</filename>, <filename
631 class="extension">*.hxx</filename>, <filename
632 class="extension">*.c</filename>, <filename
633 class="extension">*.php</filename>, <filename
634 class="extension">*.js</filename>, <filename
635 class="extension">*.cs</filename>, <filename
636 class="extension">*.ts</filename></seg>
642 </segmentedlist></para>
646 <title><filename>IgnoreFieldsComma<indexterm>
647 <primary>IgnoreFieldsComma plugin file</primary>
648 </indexterm></filename></title>
650 <para>This plugin is for files with fields and commas as delimiters (CSV
651 files, for example). It ignores the delimiter characters. The first field
654 <para>To specify the delimiters, use plugin settings dialog or rename the <filename>dll</filename> using
655 the same parameter fields used for <xref
656 linkend="IgnoreColumns" />.</para>
658 <para><segmentedlist>
659 <segtitle>Category</segtitle>
661 <segtitle>File filter</segtitle>
663 <segtitle>Plugin argument</segtitle>
665 <segtitle>Settings dialog support</segtitle>
670 <seg><filename class="extension">*.csv</filename></seg>
676 </segmentedlist></para>
680 <title><filename>IgnoreFieldsTab<indexterm>
681 <primary>IgnoreFieldsTab plugin file</primary>
682 </indexterm></filename></title>
684 <para>This plugin is for files that use fields and tabs as delimiters
685 (<application>for example, Excel</application> files saved in the <filename
686 class="extension">*.txt</filename> format). It ignores the delimiter
687 characters. The first field is number 1.</para>
689 <para>To specify the delimiters, use plugin settings dialog or rename the <filename>dll</filename> using
690 the same parameter fields used for <xref
691 linkend="IgnoreColumns" />.</para>
693 <para><segmentedlist>
694 <segtitle>Category</segtitle>
696 <segtitle>File filter</segtitle>
698 <segtitle>Plugin argument</segtitle>
700 <segtitle>Settings dialog support</segtitle>
705 <seg><filename class="extension">*.txt</filename></seg>
711 </segmentedlist></para>
715 <title><filename>IgnoreLeadingLineNumbers<indexterm>
716 <primary>IgnoreLeadingLineNumbers plugin file</primary>
717 </indexterm></filename></title>
719 <para>This plugin ignores the leading line numbers in text files (for
720 example, NC and BASIC files).</para>
722 <para><segmentedlist>
723 <segtitle>Category</segtitle>
725 <segtitle>File filter</segtitle>
727 <segtitle>Plugin argument</segtitle>
729 <segtitle>Settings dialog support</segtitle>
731 <segtitle>Requirement</segtitle>
736 <seg><filename class="extension">*.nc</filename></seg>
742 <seg><xref linkend="MSVBVM60" /></seg>
744 </segmentedlist></para>
747 <section id="EditorAddin">
748 <title><filename>editor addin<indexterm>
749 <primary>editor addin plugin file</primary>
750 </indexterm></filename></title>
752 <para>Adds five functions to the <menuchoice>
753 <guimenu>Plugins</guimenu>
755 <guisubmenu>Scripts</guisubmenu>
756 </menuchoice> menu:</para>
760 <simpara><guimenuitem>Make Uppercase</guimenuitem> convert the selection to
761 UPPER CASE.</simpara>
765 <simpara><guimenuitem>Make Lowercase</guimenuitem> convert the selection to
766 lower case.</simpara>
770 <simpara><guimenuitem>Sort Lines Ascending</guimenuitem> sort the selection
771 in ascending order.</simpara>
775 <simpara><guimenuitem>Sort Lines Descending</guimenuitem> sort the selection
776 in descending order.</simpara>
780 <simpara><guimenuitem>Apply Filter Command...</guimenuitem> replace the selection
781 with the output of the specified filter command.
782 Specifying %1 in the argument of the filter command replaces it with the filename of the active pane.</simpara>
786 <para><segmentedlist>
787 <segtitle>Category</segtitle>
788 <segtitle>File filter</segtitle>
789 <segtitle>Settings dialog support</segtitle>
792 <seg>Editor complement</seg>
796 </segmentedlist></para>
799 <section id="Plugins_datetime">
800 <title><filename>insert datetime<indexterm>
801 <primary>insert datetime plugin file</primary>
802 </indexterm></filename></title>
804 <para>Adds two functions to the <menuchoice>
805 <guimenu>Plugins</guimenu>
807 <guisubmenu>Scripts</guisubmenu>
808 </menuchoice> menu:</para>
812 <simpara><guimenuitem>Insert Date</guimenuitem> insert date in the
813 current locale format.</simpara>
817 <simpara><guimenuitem>Insert Time</guimenuitem> insert time in the
818 current locale format.</simpara>
822 <para><segmentedlist>
823 <segtitle>Category</segtitle>
825 <segtitle>File filter</segtitle>
827 <segtitle>Settings dialog support</segtitle>
830 <seg>Editor complement</seg>
836 </segmentedlist></para>
841 <title>Requirements<indexterm>
842 <primary>plugins</primary>
844 <secondary>Windows Script Host requirement</secondary>
848 <title>Windows Script Host</title>
850 <para>Some editor complement plugins require this optional component from
851 <trademark class="registered">Microsoft</trademark>.</para>
853 <para>It should already be included in your version of Windows,
854 unless you use some really old pre Windows XP version.</para>
857 <section id="MSVBVM60">
858 <title><application>Visual Basic</application> runtime library<indexterm>
859 <primary>Visual Basic dlls for plugins</primary>
860 </indexterm><indexterm>
861 <primary>plugins</primary>
863 <secondary>Visual Basic dlls</secondary>
864 </indexterm><indexterm>
865 <primary>msvbvm60.dll plugin file</primary>
866 </indexterm><indexterm>
867 <primary>Run-Time Redistribution Pack, for Visual Basic
871 <para>Some plugins require <application>the Visual Basic</application>
872 runtime library to work.</para>
874 <para>You can use the <ulink
875 url="https://www.microsoft.com/en-us/download/details.aspx?id=24417">Run-Time
876 Redistribution Pack</ulink> from <trademark
877 class="registered">Microsoft</trademark>. If you don't need the plugin,
878 you can safely remove it.</para>