Differences

This shows you the differences between the selected revisions of the page.

extension_compare_files 2019-07-04 extension_compare_files 2026-01-05 (current)
Line 2: Line 2:
This extension launches an external [[https://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools|file comparison tool]] for files selected in [[ui_file_panel|local and remote file panels]]. This extension launches an external [[https://en.wikipedia.org/wiki/Comparison_of_file_comparison_tools|file comparison tool]] for files selected in [[ui_file_panel|local and remote file panels]].
-The extension recognizes the following file comparison tools: [[https://www.prestosoft.com/edp_examdiffpro.asp|ExamDiff Pro]], [[https://www.scootersoftware.com/|Beyond Compare]], [[http://kdiff3.sourceforge.net/|KDiff3 ]], [[http://winmerge.org/|WinMerge]] and built-in Windows command-line ''[[https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/fc|fc]]''.+The extension recognizes the following file comparison tools: [[https://www.prestosoft.com/edp_examdiffpro.asp|ExamDiff Pro]], [[https://www.scootersoftware.com/|Beyond Compare]], [[https://kdiff3.sourceforge.net/|KDiff3 ]], [[https://winmerge.org/|WinMerge]], [[https://tortoisesvn.net/TortoiseMerge.html|TortoiseMerge]] and built-in Windows command-line ''[[https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/fc|fc]]''.
This is an official [[extension|WinSCP extension]] and is distributed in WinSCP installer. This is an official [[extension|WinSCP extension]] and is distributed in WinSCP installer.
Line 14: Line 14:
# @flag        ShowResultsInMsgBox # @flag        ShowResultsInMsgBox
# @flag        ApplyToDirectories # @flag        ApplyToDirectories
-# @version      1+# @version      3
# @shortcut    Shift+Ctrl+Alt+C # @shortcut    Shift+Ctrl+Alt+C
-# @homepage    https://winscp.net/eng/docs/extension_compare_files+# @homepage    ~~SELF~~
# @require      WinSCP 5.13.4 # @require      WinSCP 5.13.4
# @option      - group "Options" # @option      - group "Options"
# @option        Tool dropdownlist "Select &file comparison tool:" "" ^ # @option        Tool dropdownlist "Select &file comparison tool:" "" ^
-#                    "=Automatic" "ExamDiff Pro" "Beyond Compare" "KDiff3" "WinMerge" "fc" +#                    "=Automatic" "ExamDiff Pro" "Beyond Compare" "KDiff3" "WinMerge" ^ 
-# @optionspage  https://winscp.net/eng/docs/extension_compare_files#options+#                    "TortoiseMerge" "fc" 
 +# @optionspage  ~~SELF~~#options
param ( param (
Line 36: Line 37:
    $tools = (     $tools = (
        ("ExamDiff Pro", "$pf\ExamDiff Pro\ExamDiff.exe"),         ("ExamDiff Pro", "$pf\ExamDiff Pro\ExamDiff.exe"),
-        ("Beyond Compare", "$pf\Beyond Compare 4\BCompare.exe"),+        ("Beyond Compare", ("$pf\Beyond Compare 5\BCompare.exe", "$pf\Beyond Compare 4\BCompare.exe")),
        ("KDiff3", "$pf\KDiff3\kdiff3.exe"),         ("KDiff3", "$pf\KDiff3\kdiff3.exe"),
        ("WinMerge", "$pf\WinMerge\WinMergeU.exe"),         ("WinMerge", "$pf\WinMerge\WinMergeU.exe"),
 +        ("TortoiseMerge", "$pf\\TortoiseSVN\bin\TortoiseMerge.exe"),
        ("fc", "fc.exe")         ("fc", "fc.exe")
    )     )
Line 51: Line 53:
        {         {
            $path = $Null             $path = $Null
-            $tpath = $t[1] +            $tpaths = $t[1] 
-            if ($tpath.Contains($pf))+            foreach ($tpath in $tpaths)
            {             {
-                $path64 = $tpath.Replace($pf, $env:ProgramW6432) +                if ($tpath.Contains($pf))
-                # Only true as long as WinSCP is 32-bit +
-                $path32 = $tpath.Replace($pf, $env:ProgramFiles) +
-                if (Test-Path $path64)+
                {                 {
-                    $path = $path64+                    $path64 = $tpath.Replace($pf, $env:ProgramW6432) 
 +                    $path32on64 = $tpath.Replace($pf, ${env:ProgramFiles(x86)}) 
 +                    $path32 = $tpath.Replace($pf, $env:ProgramFiles) 
 +                    if (Test-Path $path64) 
 +                    { 
 +························$path = $path64 
 +                        break 
 +                    } 
 +                    elseif (Test-Path $path32on64) 
 +                    { 
 +                        $path = $path32on64 
 +                        break 
 +                    } 
 +                    elseif (Test-Path $path32) 
 +                    { 
 +                        $path = $path32 
 +                        break 
 +                    }
                }                 }
-                elseif (Test-Path $path32)+                else
                {                 {
-                    $path = $path32+                    $path = $tpath 
 +                    break
                }                 }
-            } 
-            else 
-            { 
-                $path = $tpath 
            }             }

Last modified: by martin