From b82da751f945f59cdf36335bbec14b6f092952db Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Sun, 3 Feb 2008 13:11:21 +0100 Subject: [PATCH] WinGit: Delete wrapper scripts as they might have been replaced by built-ins Executing a script takes precedence over executing a .exe file in MSYS when omitting the extension. If a newer Git version promoted a script to a built-in, that version will no longer come with the script version of the command. Thus, when performing an update instead of a new install, the script from the older version will be present as well as the new git.exe with the command built-in. However, typing in the command's name at the shell will still launch the script instead of (a copy of / a link to) git.exe. Therefore we now delete all scripts that have the name of a built-in before we create the built-in copies / links. --- share/WinGit/install.iss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss index 4d223884..857a09ec 100644 --- a/share/WinGit/install.iss +++ b/share/WinGit/install.iss @@ -279,6 +279,14 @@ begin Count:=GetArrayLength(BuiltIns)-1; + // Delete all scripts as they might have been replaced by built-ins by now. + for i:=0 to Count do begin + FileName:=ChangeFileExt(AppDir+'\'+BuiltIns[i],''); + if (FileExists(FileName) and (not DeleteFile(FileName))) then begin + Log('Line {#emit __LINE__}: Unable to delete script "'+FileName+'", ignoring.'); + end; + end; + // Map the built-ins to git.exe. if IsNTFS then begin Log('Line {#emit __LINE__}: Partition seems to be NTFS, trying to create built-in aliases as hard links.'); -- 2.11.4.GIT