2 # Tcl ignores the next line -*- tcl -*- \
5 # Copyright (C) 2007 Johannes E. Schindelin. All rights reserved.
6 # This program is free software; it may be used, copied, modified
7 # and distributed under the terms of the GNU General Public Licence,
8 # either version 2, or (at your option) any later version.
11 global currentDirectory answer env
14 text .listbox.list
-yscrollcommand ".listbox.scroll set"
15 scrollbar .listbox.scroll
-command ".listbox.list yview"
16 pack .listbox.scroll
-side right
-fill y
17 pack .listbox.list
-expand yes -fill both
20 set list
[open
"$currentDirectory/fileList-builtins.txt" r
]
21 while {[gets
$list line
] >= 0} {
22 .listbox.list insert end
"copying builtin: $line\n"
23 .listbox.list yview moveto
1
25 file copy
-force $currentDirectory/bin
/git.exe \
26 $currentDirectory/$line
34 set destinations
[list
]
35 set answer
[tk_dialog .question
"Desktop Icon" \
36 "Would you like to add a Git icon to the Desktop?" \
39 lappend destinations
$env(USERPROFILE
)/Desktop
42 set answer
[tk_dialog .question
"Quick Launch" \
43 "Would you like to add a Quick Launch icon?" \
46 set appdata
[regsub
-all "\\\\" $env(APPDATA
) "/"]
47 lappend destinations \
48 "$appdata/Microsoft/Internet Explorer/Quick Launch"
51 wm title .question
"Start Menu item"
52 label .question.label
-text \
53 "Would you like to add a start menu item?"
55 label .question.name.name
-text "Name:"
57 set startMenuName
"Git"
58 entry .question.name.entry
-textvariable startMenuName
59 pack .question.name.name .question.name.entry \
60 -fill x
-expand true
-side left
61 frame .question.buttons
63 button .question.buttons.
yes -text Yes
-default active \
68 bind .question
<KeyPress
> {
69 if {[string equal
%K
"Return"]} {
73 if {[string equal
%K
"Escape"]} {
78 button .question.buttons.no
-text No
-command {
82 pack .question.buttons.
yes .question.buttons.no \
83 -fill x
-expand true
-side left
84 pack .question.label .question.name .question.buttons \
86 focus
-force .question
87 tkwait window .question
89 package require registry
1.0
90 set key
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows"
91 set key
"$key\\CurrentVersion\\Explorer\\Shell Folders"
92 set programs
[registry get
$key "Programs"]
93 file mkdir
$programs/$startMenuName
94 lappend destinations
$programs/$startMenuName
98 # TODO: incorporate git-cheetah
100 foreach location
$destinations {
101 exec bin
/create-shortcut.exe
--work-dir $currentDirectory \
102 --icon-file $currentDirectory/etc
/git.ico \
103 --arguments "--login -i" \
104 --description "Git for MSys" \
105 $currentDirectory/bin
/sh.exe
$location/Git.lnk
108 tk_dialog .info
"WinGit installed" \
109 "WinGit was successfully installed" info
0 OK
115 set currentDirectory
[lindex
$argv 0]