diff --git a/git-gui/lib/shortcut.tcl b/git-gui/lib/shortcut.tcl index 78878ef89d1121..715916b65904e7 100644 --- a/git-gui/lib/shortcut.tcl +++ b/git-gui/lib/shortcut.tcl @@ -11,11 +11,17 @@ proc do_windows_shortcut {} { if {[file extension $fn] ne {.lnk}} { set fn ${fn}.lnk } + # Use /cmd/git-gui.exe if available + set normalized [file normalize $::argv0] + regsub "/mingw../libexec/git-core/git-gui$" \ + $normalized "/cmd/git-gui.exe" cmdLine + if {$cmdLine != $normalized && [file exists $cmdLine]} { + set cmdLine [list [file nativename $cmdLine]] + } else { + set cmdLine [list [info nameofexecutable] $normalized] + } if {[catch { - win32_create_lnk $fn [list \ - [info nameofexecutable] \ - [file normalize $::argv0] \ - ] \ + win32_create_lnk $fn $cmdLine \ [file normalize $_gitworktree] } err]} { error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]