Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Fixes Git detection on 64-bit Windows machines with 32-bit Git installed #324

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions windows/Toolbox.iss
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,21 @@ begin
end;

function NeedToInstallGit(): Boolean;
var
GitRegKey, GitInstallPath: String;
begin
// TODO: Find a better way to see if Git is installed
Result := not DirExists('C:\Program Files\Git') or not FileExists('C:\Program Files\Git\git-bash.exe')
GitRegKey := 'GitForWindows';

if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Wow6432Node\' + GitRegKey, 'InstallPath', GitInstallPath) and FileExists(GitInstallPath + '\git-bash.exe') then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Any way this function could return the git path (and optionally Null)? This could be used to detect where to point the Docker Quickstart Terminal to

// Git 32-bit installed on a Windows 64-bit machine
Result := False
end else if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\' + GitRegKey, 'InstallPath', GitInstallPath) and FileExists(GitInstallPath + '\git-bash.exe') then
// Git 64-bit installed on a Windows 64-bit machine OR Git 32-bit installed on a Windows 32-bit machine
Result := False
end else
// Git not found
Result := True
end
end;

procedure InitializeWizard;
Expand Down