Skip to content

Commit 09a3fe2

Browse files
patthoytsdscho
authored andcommitted
git-gui (Windows): use git-gui.exe in Create Desktop Shortcut
When calling `Repository>Create Desktop Shortcut`, Git GUI assumes that it is okay to call `wish.exe` directly on Windows. However, in Git for Windows 2.x' context, that leaves several crucial environment variables uninitialized, resulting in a shortcut that does not work. To fix those environment variable woes, Git for Windows comes with a convenient `git-gui.exe`, so let's just use it when it is available. This fixes #448 Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Pat Thoyts <[email protected]> Signed-off-by: Johannes Schindelin <[email protected]>
1 parent c7cab7c commit 09a3fe2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

git-gui/lib/shortcut.tcl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ proc do_windows_shortcut {} {
1111
if {[file extension $fn] ne {.lnk}} {
1212
set fn ${fn}.lnk
1313
}
14+
# Use git-gui.exe if available (ie: git-for-windows)
15+
set cmdLine [auto_execok git-gui.exe]
16+
if {$cmdLine eq {}} {
17+
set cmdLine [list [info nameofexecutable] \
18+
[file normalize $::argv0]]
19+
}
1420
if {[catch {
15-
win32_create_lnk $fn [list \
16-
[info nameofexecutable] \
17-
[file normalize $::argv0] \
18-
] \
21+
win32_create_lnk $fn $cmdLine \
1922
[file normalize $_gitworktree]
2023
} err]} {
2124
error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]

0 commit comments

Comments
 (0)