From 22051f939b88ed5d837a4b914a8db284f659762d Mon Sep 17 00:00:00 2001 From: Sebastian Schuberth Date: Tue, 16 Oct 2007 19:02:47 +0200 Subject: [PATCH] WinGit(Inno): Make uninstaller remove directory from PATH The uninstaller did not remove the directory Git was installed to from PATH. It now does, as well as any directories below the installation directory in PATH. For convenience, this is also done if the directories in PATH were not added by the installer in the first place, as they will become invalid after uninstallation anyways. --- share/WinGit/install.iss | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/share/WinGit/install.iss b/share/WinGit/install.iss index 396b4d12..0bd353f0 100644 --- a/share/WinGit/install.iss +++ b/share/WinGit/install.iss @@ -300,3 +300,28 @@ begin SetEnvPathStrings(True,DirStrings); end; end; + +procedure CurUninstallStepChanged(CurUninstallStep:TUninstallStep); +var + AppDir:string; + DirStrings:TArrayOfString; + i:Longint; +begin + if CurUninstallStep=usDone then begin + AppDir:=ExpandConstant('{app}'); + + // Get the current user's directories in PATH. + DirStrings:=GetEnvPathStrings(True); + + // Remove the installation directory from PATH in any case, even if it + // was not added by the installer. + for i:=0 to GetArrayLength(DirStrings)-1 do begin + if Pos(AppDir,DirStrings[i])=1 then begin + DirStrings[i]:=''; + end; + end; + + // Set the current user's directories in PATH. + SetEnvPathStrings(True,DirStrings); + end; +end; -- 2.11.4.GIT