Installer: Fix the registry-based menu entries for Windows XP (fixes #95)
authorSebastian Schuberth <sschuberth@gmail.com>
Tue, 5 Feb 2013 08:51:55 +0000 (5 09:51 +0100)
committerSebastian Schuberth <sschuberth@gmail.com>
Tue, 5 Feb 2013 08:56:24 +0000 (5 09:56 +0100)
The non-Background entries require the use of "%1" instead of "%v" on
Windows XP. The Background entries require "%v", but these are not
available under Windows XP anyway. This current solution was also tested
on Windows 8 and it works fine there, too.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
share/WinGit/install.iss

index 838db90..77e7587 100644 (file)
@@ -1162,9 +1162,10 @@ begin
 \r
     if IsComponentSelected('ext\reg\shellhere') then begin\r
         Msg:='Git Ba&sh Here';\r
-        Cmd:='"'+ExpandConstant('{syswow64}')+'\wscript" "'+AppDir+'\Git Bash.vbs" "%v"';\r
+        Cmd:='"'+ExpandConstant('{syswow64}')+'\wscript" "'+AppDir+'\Git Bash.vbs" "%1"';\r
         if (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\shell\git_shell','',Msg)) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\shell\git_shell\command','',Cmd)) or\r
+           (StringChangeEx(Cmd,'%1','%v',false)<>1) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\Background\shell\git_shell','',Msg)) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\Background\shell\git_shell\command','',Cmd)) then begin\r
             Msg:='Line {#__LINE__}: Unable to create "Git Bash Here" shell extension.';\r
@@ -1177,9 +1178,10 @@ begin
 \r
     if IsComponentSelected('ext\reg\guihere') then begin\r
         Msg:='Git &GUI Here';\r
-        Cmd:='"'+AppDir+'\bin\wish.exe" "'+AppDir+'\libexec\git-core\git-gui" "--working-dir" "%v"';\r
+        Cmd:='"'+AppDir+'\bin\wish.exe" "'+AppDir+'\libexec\git-core\git-gui" "--working-dir" "%1"';\r
         if (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\shell\git_gui','',Msg)) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\shell\git_gui\command','',Cmd)) or\r
+           (StringChangeEx(Cmd,'%1','%v',false)<>1) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\Background\shell\git_gui','',Msg)) or\r
            (not RegWriteStringValue(RootKey,'SOFTWARE\Classes\Directory\Background\shell\git_gui\command','',Cmd)) then begin\r
             Msg:='Line {#__LINE__}: Unable to create "Git GUI Here" shell extension.';\r