3 switch -regexp [lindex $argv 0] {
4 "^(|help|-h|-help|--help)$" {
5 puts "Usage: $argv0 \[option\]"
8 puts " QuickLaunch create a QuickLaunch icon"
9 puts " Desktop create an icon on the Desktop"
10 puts " StartMenu create an icon in your start menu"
11 puts " StartMenu2 create an icon in start menu's Programs>msysGit"
12 puts " AllUsersStartMenu create an icon in All Users' start menu"
13 puts " AllUsersStartMenu2 create an icon in All Users'"
14 puts " start menu's Programs>msysGit"
15 puts " EnableQuickEdit enable the QuickEdit mode in the console"
17 puts "Short options are q, d, s, s2, a and a2."
20 "^(quicklaunch|QuickLaunch|q)$" {
22 "$env(APPDATA)/Microsoft/Internet Explorer/Quick Launch"
24 "^(Desktop|desktop|d)$" {
25 set targetDirectory
"$env(USERPROFILE)/Desktop"
27 "^(StartMenu|startmenu|start|s)$" {
28 package require
registry 1.0
29 set key
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows"
30 set key
"$key\\CurrentVersion\\Explorer\\Shell Folders"
31 set targetDirectory
[registry get
$key "Start Menu"]
33 "^(StartMenu2|startmenu2|start2|s2)$" {
34 set startMenuName
"msysGit"
35 package require
registry 1.0
36 set key
"HKEY_CURRENT_USER\\Software\\Microsoft\\Windows"
37 set key
"$key\\CurrentVersion\\Explorer\\Shell Folders"
38 set programs
[registry get
$key "Programs"]
39 file mkdir
$programs/$startMenuName
40 set targetDirectory
$programs/$startMenuName
42 "^(AllUsersStartMenu|allusersstartmenu|allusers|a)$" {
43 package require
registry 1.0
44 set key
"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows"
45 set key
"$key\\CurrentVersion\\Explorer\\Shell Folders"
46 set targetDirectory
[registry get
$key "Common Start Menu"]
48 "^(AllUsersStartMenu2|allusersstartmenu2|allusers2|a2)$" {
49 set startMenuName
"msysGit"
50 package require
registry 1.0
51 set key
"HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows"
52 set key
"$key\\CurrentVersion\\Explorer\\Shell Folders"
53 set programs
[registry get
$key "Common Programs"]
54 file mkdir
$programs/$startMenuName
55 set targetDirectory
$programs/$startMenuName
57 "^(EnableQuickEdit|quickedit)$" {
58 package require
registry 1.0
59 regsub "^(.*)/etc/inputrc" $env(INPUTRC
) "\\1" msysRoot
60 set sh
[string map
{ "\\" "_" "/" "_" } $msysRoot/bin
/sh.exe
]
61 set key
"HKEY_CURRENT_USER\\Console"
62 registry set $key "QuickEdit" 1 dword
63 registry set $key "HistoryBufferSize" 999 dword
64 registry broadcast
$key
65 registry broadcast
"Console"
69 puts "Unknown argument: [lindex $argv 0]"
74 cd [file dirname
$argv0]
76 regsub "^(.*)/etc/inputrc" $env(INPUTRC
) "\\1" msysRoot
79 set binDirectory
"$msysRoot/bin"
80 set resDirectory
"$msysRoot/share/resources"
82 set command
"$binDirectory/sh.exe"
83 set arguments
"--login -i"
84 if {$env(COMMONPROGRAMW6432
) != ""} {
85 set command
"%WINDIR%\\SysWOW64\\cmd.exe"
86 set arguments
"/c \"$binDirectory/sh.exe\" --login -i"
88 exec .
/create-shortcut.exe
--work-dir
"%HOMEDRIVE%%HOMEPATH%" \
89 --icon-file
"$resDirectory/msysgitlogo.ico" \
90 --arguments $arguments \
92 "$targetDirectory/msysGit.lnk"